import { Banknote, CreditCard, Smartphone } from 'lucide-react';
import { cn } from '@/lib/utils';

interface PaymentBadgeProps {
  method: 'cash' | 'transfer' | 'qris';
}

const methodConfig: Record<string, { label: string; icon: typeof Banknote; className: string }> = {
  cash: {
    label: 'Cash',
    icon: Banknote,
    className: 'bg-emerald-50 text-emerald-700 border-emerald-200/60',
  },
  transfer: {
    label: 'Transfer',
    icon: CreditCard,
    className: 'bg-sky-50 text-sky-700 border-sky-200/60',
  },
  qris: {
    label: 'QRIS',
    icon: Smartphone,
    className: 'bg-violet-50 text-violet-700 border-violet-200/60',
  },
};

export default function PaymentBadge({ method }: PaymentBadgeProps) {
  const config = methodConfig[method] || methodConfig.cash;
  const Icon = config.icon;

  return (
    <span
      className={cn(
        'inline-flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-[11px] font-medium',
        config.className
      )}
    >
      <Icon className="h-3 w-3" />
      {config.label}
    </span>
  );
}
