// Same visual pattern as OrderStatusBadge — but answers a different
// question ("hat Stripe/die Buchhaltung eine Zahlung bestätigt?", not
// "wo im Fulfillment steht die Bestellung"). 'not_applicable' (an
// Überweisung order before payment is manually reconciled) reads as
// "offen", same as a still-'pending' Stripe order — the customer doesn't
// need to know the internal distinction between the two.
const LABEL: Record<string, string> = {
  not_applicable: "Offen",
  pending: "Offen",
  paid: "Bezahlt",
  failed: "Fehlgeschlagen",
  refunded: "Erstattet",
  partially_refunded: "Teilweise erstattet",
};

const STYLES: Record<string, string> = {
  not_applicable: "bg-red-50 text-red-600",
  pending: "bg-red-50 text-red-600",
  paid: "bg-success-subtle text-success",
  failed: "bg-red-50 text-red-600",
  refunded: "bg-bg-muted text-text-light",
  partially_refunded: "bg-orange-50 text-orange-600",
};

export function PaymentStatusBadge({ paymentStatus }: { paymentStatus: string }) {
  return (
    <span
      className={`self-start inline-flex items-center px-2.5 py-1 rounded-full text-label font-bold whitespace-nowrap ${STYLES[paymentStatus] ?? "bg-bg-muted text-text-muted"}`}
    >
      {LABEL[paymentStatus] ?? paymentStatus}
    </span>
  );
}
