import type { EnvironmentMachineKind } from "@t3tools/contracts"; import { CloudIcon, LaptopIcon, MonitorIcon, ServerIcon, type LucideProps } from "lucide-react"; import type { FunctionComponent, SVGProps } from "react"; import { LinuxIcon } from "./Icons"; // Lucide has no Apple desktops, so these two are drawn to its grammar (24 // unit grid, 2 unit stroke, round joins) and share its prop surface so callers // can swap freely. function LucideLike(props: SVGProps) { return ( ); } /** A Mac mini: squat rounded slab with a front-edge LED. */ function MacMiniIcon(props: SVGProps) { return ( ); } /** A Mac Studio: the same slab twice as tall, ports along the front foot. */ function MacStudioIcon(props: SVGProps) { return ( ); } const ICON_BY_KIND: Record> = { server: ServerIcon, cloud: CloudIcon, linux: LinuxIcon, desktop: MonitorIcon, laptop: LaptopIcon, "mac-mini": MacMiniIcon, "mac-studio": MacStudioIcon, }; export const ENVIRONMENT_MACHINE_KIND_LABELS: Record = { server: "Server", cloud: "Cloud VM", linux: "Linux/WSL", desktop: "Desktop", laptop: "Laptop", "mac-mini": "Mini PC", "mac-studio": "Workstation", }; export function environmentMachineIcon( kind: EnvironmentMachineKind, ): FunctionComponent { return ICON_BY_KIND[kind]; } export function EnvironmentMachineIcon({ kind, ...props }: LucideProps & { readonly kind: EnvironmentMachineKind }) { const Icon = ICON_BY_KIND[kind]; return ; }