Repository Public
1import type { Lifecycle } from "@/lib/schemas";23export const chipShort = (chip: string) => chip.replace(/^Apple\s+/, "");45const TONE: Record<Lifecycle, string> = {6 active: "text-ok border-ok/30 bg-ok/10",7 offline: "text-warn border-warn/30 bg-warn/10",8 maintenance: "text-warn border-warn/30 bg-warn/10",9 planned: "text-accent border-accent/30 bg-accent-soft",10 retired: "text-mute border-line-strong",11 unverified: "text-mute border-line-strong",12};1314export function LifecycleBadge({ state, label }: { state: Lifecycle; label: string }) {15 return (16 <span className={`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 font-mono text-[0.625rem] uppercase tracking-[0.1em] ${TONE[state]}`}>17 <span aria-hidden="true" className="h-1 w-1 rounded-full bg-current" />18 {label}19 </span>20 );21}22