import { Badge } from "@/components/ui/badge";

const TONES: Record<string, string> = {
  draft: "bg-slate-100 text-slate-700 hover:bg-slate-100",
  sent: "bg-blue-100 text-blue-700 hover:bg-blue-100",
  overdue: "bg-red-100 text-red-700 hover:bg-red-100",
  paid: "bg-emerald-100 text-emerald-700 hover:bg-emerald-100",
  accepted: "bg-emerald-100 text-emerald-700 hover:bg-emerald-100",
  declined: "bg-red-100 text-red-700 hover:bg-red-100",
  void: "bg-slate-100 text-slate-500 line-through hover:bg-slate-100",
  open: "bg-blue-100 text-blue-700 hover:bg-blue-100",
  "partially paid": "bg-amber-100 text-amber-700 hover:bg-amber-100",
};

export function StatusBadge({ status }: { status: string }) {
  const cls = TONES[status] ?? "bg-slate-100 text-slate-700";
  return (
    <Badge variant="secondary" className={`${cls} border-0 font-medium capitalize`}>
      {status}
    </Badge>
  );
}
