import type { CrmRecordStatus } from "@mrp/shared/dist/crm/types.js";

import { crmStatusOptions, crmStatusPalette } from "./config";

export function CrmStatusBadge({ status }: { status: CrmRecordStatus }) {
  const label = crmStatusOptions.find((option) => option.value === status)?.label ?? status;

  return (
    <span className={`inline-flex rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-[0.16em] ${crmStatusPalette[status]}`}>
      {label}
    </span>
  );
}
