import { cn } from "@/lib/utils"; import { resolveStatus } from "@/lib/workflow"; interface Props { value: string | null | undefined; /** `sm` for table cells, `md` for the detail header. */ size?: "sm" | "md"; /** Show the state icon alongside the dot. Off in dense tables. */ withIcon?: boolean; className?: string; } /** * The one status pill. Colour, label and icon all come from lib/workflow, so a * state looks identical in a table cell, a detail header and a chart legend. */ export default function StatusBadge({ value, size = "sm", withIcon = false, className }: Props) { const status = resolveStatus(value); if (!status) return null; const { label, tone, pulse, icon: Icon } = status; return ( {withIcon ? ( ) : ( )} {label} ); }