/** * `Workspace` — the IDE shell rendered when at least one project tab is open * (or when the launcher overlay is forced visible). * * Layout (full remaining height): * * ┌──────────────────────────────────────────────────────────┐ * │ PROJECT TABS [ alpha × ][ beta × ] [+] │ * ├────────────────┬─────────────────────────────────────────┤ * │ SIDEBAR ≈320px │ MAIN — LayoutGrid (fills remaining) │ * │ [Agents][Tmp.] │ │ * │ [Git] │ │ * │ panel content │ │ * └────────────────┴─────────────────────────────────────────┘ * * The sidebar panel is selected via `sidebarTab`; the LayoutGrid fills the rest. * All content is passed as render props / children; no domain logic here. */ import { cn } from "@/shared"; export type SidebarTab = "agents" | "templates" | "git"; interface WorkspaceProps { /** Project tab bar (optional — hidden when no projects are open). */ projectTabBar?: React.ReactNode; /** Whether to show the launcher overlay instead of the sidebar+main layout. */ showLauncher?: boolean; /** The launcher component (shown when showLauncher is true). */ launcher?: React.ReactNode; /** Currently-selected sidebar tab. */ sidebarTab: SidebarTab; onSidebarTab: (tab: SidebarTab) => void; /** Panel content for the sidebar body. */ agentsPanel: React.ReactNode; templatesPanel: React.ReactNode; gitPanel: React.ReactNode; /** The main LayoutGrid area. */ layoutGrid: React.ReactNode; } const SIDEBAR_TABS: { id: SidebarTab; label: string }[] = [ { id: "agents", label: "Agents" }, { id: "templates", label: "Templates" }, { id: "git", label: "Git" }, ]; export function Workspace({ projectTabBar, showLauncher = false, launcher, sidebarTab, onSidebarTab, agentsPanel, templatesPanel, gitPanel, layoutGrid, }: WorkspaceProps) { return (