import type { LedKind } from "@unlocalhosted/metalui"; import type { Status } from "@/lib/issue-meta"; // Linear-style status and priority glyphs, drawn on MetalUI's 24 grid at its 1.7 stroke and coloured // like its LEDs: green open, amber in progress or urgent, unlit (ink3) idle and closed. const AMBER = "text-[#c98a18]"; const STATUS_COLORS: Record = { backlog: "text-ink3", todo: "text-green-deep", in_progress: AMBER, in_review: AMBER, done: "text-ink3", canceled: "text-ink3", }; /** The LED that names a status beside its words (StatusBadge, Led). */ export const STATUS_LED: Record = { backlog: "off", todo: "live", in_progress: "waiting", in_review: "waiting", done: "off", canceled: "off", }; const RING = 9.15; /** A pie slice filling `fraction` of the inner disc, starting at 12 o'clock. */ function Pie({ fraction }: { fraction: number }) { const r = 3.4; const c = 2 * Math.PI * r; return ( ); } export function StatusIcon({ status, size = 14, className = "" }: { status: Status; size?: number; className?: string }) { return ( {status === "backlog" && ( )} {(status === "todo" || status === "in_progress" || status === "in_review") && ( )} {status === "in_progress" && } {status === "in_review" && } {status === "done" && ( <> )} {status === "canceled" && ( <> )} ); } export function PriorityIcon({ priority, size = 14, className = "" }: { priority: number; size?: number; className?: string }) { if (priority === 1) { return ( ); } if (priority === 0) { return ( {[3.4, 10.2, 17].map((x) => ( ))} ); } // High fills three bars, medium two, low one. const filled = 5 - priority; return ( {[0, 1, 2].map((i) => ( ))} ); } /** A label's colour as a small lit swatch: the colour under the LED's hairline ring and top light. */ export function LabelDot({ color, size = 8 }: { color: string; size?: number }) { return ( ); } /** A label on MetalUI's tag chip: a hairline pill with the swatch and the name. */ export function LabelChip({ name, color }: { name: string; color: string }) { return ( {name} ); }