import { cn } from '@/lib/utils';
import type { PlanName } from '@/types/admin';

const planColors: Record<PlanName, string> = {
    Enterprise: 'bg-primary/15 text-primary border border-primary/25',
    Professional:
        'bg-teal-100 text-teal-700 border border-teal-200 dark:bg-teal-900/40 dark:text-teal-300 dark:border-teal-700/40',
    Starter:
        'bg-amber-100 text-amber-700 border border-amber-200 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-700/30',
    'Free Trial': 'bg-muted text-muted-foreground border border-border',
};

export default function PlanBadge({ plan }: { plan: PlanName | string }) {
    return (
        <span
            className={cn(
                'rounded-full px-2.5 py-0.5 text-[11px] font-semibold',
                planColors[plan as PlanName] ??
                    'bg-muted text-muted-foreground border-border border',
            )}
        >
            {plan}
        </span>
    );
}
