import { cn } from '@/lib/utils';
import { STATUS_CONFIG, UserStatus } from './constants';

export function StatusBadge({ status }: { status: UserStatus | string }) {
  const cfg = STATUS_CONFIG[status as UserStatus] ?? STATUS_CONFIG.inactive;
  return (
    <span
      className={cn(
        'inline-flex items-center gap-1.5 px-3 py-1 text-[10px] font-bold uppercase tracking-widest border rounded-full',
        cfg.badgeBg,
        cfg.badgeText,
        cfg.badgeBorder
      )}
    >
      <span className={cn('w-1.5 h-1.5 rounded-full', cfg.dot)} />
      {cfg.label}
    </span>
  );
}
