import { Badge, Group } from "@mantine/core"; import { Repeat } from "lucide-react"; import { CONTRACT_STATUS_COLOR, CONTRACT_STATUS_STYLES, } from "@/features/contracts/contract-status.config"; interface ContractStatusBadgeProps { status: string; /** When the contract is a renewal of a prior one, show a sibling badge. */ isRenewal?: boolean; } export function ContractStatusBadge({ status, isRenewal, }: ContractStatusBadgeProps) { const style = CONTRACT_STATUS_STYLES[status] ?? { label: status, color: "gray", }; const color = CONTRACT_STATUS_COLOR[status] ?? "gray"; const statusBadge = ( {style.label} ); if (!isRenewal) return statusBadge; return ( {statusBadge} } title="Renewal of a prior contract" style={{ fontSize: "0.7rem", letterSpacing: "0.05em", display: "inline-flex", whiteSpace: "nowrap", }} > Renewal ); }