import { cn } from '@/lib/utils';

const tones = {
    success: 'bg-highlight-faint text-highlight-dark',
    pending: 'bg-amber-50 text-amber-700',
    failed: 'bg-red-50 text-red-700',
    neutral: 'bg-surface-100 text-ink-500',
    info: 'bg-brand-faint text-brand',
} as const;

export type BadgeTone = keyof typeof tones;

export default function StatusBadge({
    tone,
    children,
}: {
    tone: BadgeTone;
    children: React.ReactNode;
}) {
    return (
        <span
            className={cn(
                'inline-flex shrink-0 items-center rounded-full px-2.5 py-0.5 text-xs font-semibold',
                tones[tone],
            )}
        >
            {children}
        </span>
    );
}
