import { cn } from '@/lib/utils';
const variants: Record<string, string> = {
    draft: 'bg-gray-100 text-gray-700',
    submitted: 'bg-yellow-100 text-yellow-800',
    approved: 'bg-blue-100 text-blue-800',
    sent: 'bg-blue-100 text-blue-800',
    received: 'bg-green-100 text-green-800',
    delivered: 'bg-green-100 text-green-800',
    cancelled: 'bg-red-100 text-red-800',
    rejected: 'bg-red-100 text-red-800',
    overdue: 'bg-orange-100 text-orange-800',
    active: 'bg-green-100 text-green-700',
    inactive: 'bg-gray-100 text-gray-500',
    issued: 'bg-indigo-100 text-indigo-800',
    in_transit: 'bg-purple-100 text-purple-800',
    pending: 'bg-yellow-100 text-yellow-700',
};
export function Badge({ status, label, className }: { status?: string; label?: string; className?: string }) {
    const key = status?.toLowerCase().replace(' ','_') ?? '';
    return <span className={cn('inline-flex items-center px-2 py-0.5 rounded text-xs font-medium capitalize', variants[key] ?? 'bg-gray-100 text-gray-700', className)}>{label ?? status?.replace('_',' ')}</span>;
}
