import { cn } from '../../lib/utils';
import type { ReactNode } from 'react';

interface BadgeProps {
  variant?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
  children: ReactNode;
  className?: string;
  icon?: ReactNode;
  'aria-label'?: string;
}

export function Badge({ variant = 'neutral', children, className, icon, 'aria-label': ariaLabel }: BadgeProps) {
  const variants = {
    primary: 'bg-primary-50 text-primary-700 border border-primary-200',
    success: 'bg-success-50 text-success-700 border border-success-200',
    warning: 'bg-warning-50 text-warning-700 border border-warning-200',
    danger: 'bg-danger-50 text-danger-700 border border-danger-200',
    info: 'bg-blue-50 text-blue-700 border border-blue-200',
    neutral: 'bg-surface-100 text-surface-600 border border-surface-200',
  };

  return (
    <span className={cn('badge', variants[variant], className)} aria-label={ariaLabel}>
      {icon}
      {children}
    </span>
  );
}
