import type { SalesDocumentStatus } from "@mrp/shared/dist/sales/types.js";

import { salesStatusOptions, salesStatusPalette } from "./config";

export function SalesStatusBadge({ status }: { status: SalesDocumentStatus }) {
  const label = salesStatusOptions.find((option) => option.value === status)?.label ?? status;

  return <span className={`inline-flex rounded-full px-2 py-1 text-xs font-semibold uppercase tracking-[0.12em] ${salesStatusPalette[status]}`}>{label}</span>;
}
