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

type BadgeVariant = 'success' | 'destructive' | 'warning' | 'default'

interface StatusBadgeProps {
  variant?: BadgeVariant
  children: React.ReactNode
  className?: string
}

const variantClasses: Record<BadgeVariant, string> = {
  success: 'bg-emerald-400/10 text-emerald-400',
  destructive: 'bg-red-400/10 text-red-400',
  warning: 'bg-yellow-400/10 text-yellow-400',
  default: 'bg-accent text-muted-foreground',
}

export function StatusBadge({ variant = 'default', children, className }: StatusBadgeProps) {
  return (
    <span className={cn(
      'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',
      variantClasses[variant],
      className
    )}>
      {children}
    </span>
  )
}

export default StatusBadge
