import { Laptop, Monitor, Terminal, type LucideIcon } from "lucide-react"; import { cn } from "@/lib/cn"; import type { SystemStatus } from "@/lib/types"; const osIcons: Record = { linux: Terminal, apple: Laptop, windows: Monitor, }; function formatMs(value: number): string { return value >= 100 ? `${Math.round(value)}ms` : `${value.toFixed(1)}ms`; } export function StatusPill({ status }: { status?: SystemStatus }) { if (!status) return null; const OsIcon = osIcons[status.os.icon] ?? Monitor; return ( ENV: {status.env.toUpperCase()} · {status.git_hash} · {status.os.name} · {formatMs(status.server_time_ms)} {status.e621_time_ms !== null ? ( <> · e621: {formatMs(status.e621_time_ms)} ) : null} ); }