/**
 * 状态徽章组件
 * 统一各页面的状态标签样式，替代重复的 `px-2 py-0.5 rounded text-xs` 模式
 */

interface StatusBadgeProps {
  /** 状态文本 */
  label: string
  /** 颜色变体 */
  variant?: 'success' | 'warning' | 'danger' | 'info' | 'neutral' | 'purple'
  /** 自定义 className */
  className?: string
}

const variantStyles: Record<string, string> = {
  success: 'bg-green-50 text-safe',
  warning: 'bg-yellow-50 text-yellow-700',
  danger: 'bg-red-50 text-danger',
  info: 'bg-blue-50 text-blue-600',
  neutral: 'bg-gray-100 text-gray-500',
  purple: 'bg-purple-50 text-purple-700',
}

/**
 * 状态徽章
 */
export default function StatusBadge({ label, variant = 'neutral', className = '' }: StatusBadgeProps) {
  return (
    <span className={`px-2 py-0.5 rounded text-xs ${variantStyles[variant]} ${className}`}>
      {label}
    </span>
  )
}
