Fixed change management rendering error
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import React from 'react';
|
||||
import { ApprovalStatus, Priority, ActivityStatus } from '../../types';
|
||||
import { getApprovalStatusBadge, getPriorityBadge, getActivityStatusBadge } from '../../lib/formatters';
|
||||
|
||||
export const ApprovalStatusBadge: React.FC<{ status: ApprovalStatus | number | null | undefined }> = ({ status }) => {
|
||||
const badge = getApprovalStatusBadge(status ?? ApprovalStatus.Pending);
|
||||
return (
|
||||
<span className={`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-semibold border whitespace-nowrap ${badge.className}`}>
|
||||
{badge.dot && <span className={`w-1.5 h-1.5 rounded-full ${badge.dot}`} />}
|
||||
<span>{badge.label}</span>
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export const PriorityBadge: React.FC<{ priority: Priority | number | null | undefined }> = ({ priority }) => {
|
||||
const badge = getPriorityBadge(priority ?? Priority.Medium);
|
||||
return (
|
||||
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-[11px] font-semibold border whitespace-nowrap ${badge.className}`}>
|
||||
<span>{badge.label}</span>
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export const ActivityStatusBadge: React.FC<{ status: ActivityStatus | number | string | boolean | null | undefined }> = ({ status }) => {
|
||||
const badge = getActivityStatusBadge(status);
|
||||
return (
|
||||
<span className={`inline-flex items-center px-2.5 py-0.5 rounded-full text-[11px] font-semibold border whitespace-nowrap ${badge.className}`}>
|
||||
<span>{badge.label}</span>
|
||||
</span>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user