import { LaptopIcon, CpuIcon, UsersIcon } from "lucide-react"; import { cn } from "../lib/cn"; import type { MachineKind, MachineState } from "../types/machines"; import { ConnectionStatusPill, MACHINE_STATE_BADGE_META } from "./machine-status-pill"; import { connectionStatusForState } from "../types/machines"; import { useOpenGeniText } from "../messages/runtime"; export type MachineDockBarProps = { /** The active machine's display name. */ name: string; kind: MachineKind; state: MachineState; /** Live sessions sharing this whole-machine lease (>1 ⇒ shared disclosure). */ sharedSessionCount?: number | undefined; className?: string | undefined; }; /** * A slim bar that surfaces WHICH machine the dock surfaces (Files/Terminal/ * Desktop) are bound to + its connection status. Mounted above the dock tabs so * the user always knows whether they are looking at the Modal box or their own * machine, and whether it is online / reconnecting / offline. The surfaces below * render IDENTICALLY regardless of backend — this bar is the only backend-aware * chrome (the dock-parity contract: selfhosted == Modal for the surfaces). */ export function MachineDockBar({ name, kind, state, className }: MachineDockBarProps) { const t = useOpenGeniText(); const Icon = kind === "selfhosted" || kind === "local" ? LaptopIcon : CpuIcon; const stateBadge = MACHINE_STATE_BADGE_META(t)[state]; return (