import { type TicketPriority } from '@/types';
import { Badge } from '@/components/ui/badge';

const priorityConfig: Record<TicketPriority, { label: string; className: string }> = {
    low: {
        label: 'Low',
        className: 'bg-slate-100 text-slate-700 dark:bg-slate-900/30 dark:text-slate-400 border-slate-200 dark:border-slate-700',
    },
    medium: {
        label: 'Medium',
        className: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400 border-blue-200 dark:border-blue-800',
    },
    high: {
        label: 'High',
        className: 'bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400 border-orange-200 dark:border-orange-800',
    },
    critical: {
        label: 'Critical',
        className: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400 border-red-200 dark:border-red-800 animate-pulse',
    },
};

export function TicketPriorityBadge({ priority }: { priority: TicketPriority }) {
    const config = priorityConfig[priority];
    return (
        <Badge variant="outline" className={`font-medium ${config.className}`}>
            {config.label}
        </Badge>
    );
}
