import React from 'react';
import { ApprovalStatus, Priority, ActivityStatus, UserRole } from '../../types';
import {
getApprovalStatusBadge,
getPriorityBadge,
getActivityStatusBadge,
getUserRoleBadge,
} from '../../lib/formatters';
export const ApprovalStatusBadge: React.FC<{ status: ApprovalStatus | number | null | undefined }> = ({ status }) => {
const badge = getApprovalStatusBadge(status ?? ApprovalStatus.Pending);
return (
{badge.dot && }
{badge.label}
);
};
export const PriorityBadge: React.FC<{ priority: Priority | number | null | undefined }> = ({ priority }) => {
const badge = getPriorityBadge(priority ?? Priority.Medium);
return (
{badge.label}
);
};
export const ActivityStatusBadge: React.FC<{ status: ActivityStatus | number | string | boolean | null | undefined }> = ({ status }) => {
const badge = getActivityStatusBadge(status);
return (
{badge.label}
);
};
export const UserRoleBadge: React.FC<{ role: string | number | UserRole | null | undefined; className?: string }> = ({
role,
className = '',
}) => {
const badge = getUserRoleBadge(role);
return (
{badge.dot && }
{badge.label}
);
};