import { useEffect, useState } from "react" import { Activity, Code, Bookmark, Wrench, ArrowLeft, type LucideIcon } from "lucide-react" import { ConnectView } from "@/views/ConnectView" import { MemoryView } from "@/views/MemoryView" import { SystemDrawer } from "@/components/SystemDrawer" import { useHealth } from "@/lib/queries" import { cn } from "@/lib/utils" import { Mc3Start } from "./Mc3Start" import { Mc3Maschinenraum } from "./Mc3Maschinenraum" // MC3-Prototyp-Schale. Läuft nicht-destruktiv unter #mc3, das produktive MC2 bleibt // unangetastet. Vier Türen; Innereien sind bewusst die bestehenden, bewährten Views. type Door = "start" | "vibe" | "konstitution" | "maschinenraum" const DOORS: { id: Door; label: string; icon: LucideIcon }[] = [ { id: "start", label: "Start", icon: Activity }, { id: "vibe", label: "Vibe-Coding", icon: Code }, { id: "konstitution", label: "Konstitution", icon: Bookmark }, { id: "maschinenraum", label: "Maschinenraum", icon: Wrench }, ] export function Mc3App() { const [door, setDoor] = useState("start") const [drawerOpen, setDrawerOpen] = useState(false) const [drawerTab, setDrawerTab] = useState<"maintenance" | "logs">("maintenance") const { data: health } = useHealth() useEffect(() => { const onOpen = (e: Event) => { setDrawerTab(((e as CustomEvent).detail?.tab as "maintenance" | "logs") || "maintenance") setDrawerOpen(true) } window.addEventListener("open-system-drawer", onOpen) return () => window.removeEventListener("open-system-drawer", onOpen) }, []) const boxOk = health && health.engine_reachable && (health.brain ? health.brain.ready : true) return (
setDrawerOpen(false)} defaultTab={drawerTab} /> {/* Sidebar — 4 Türen */} {/* Main */}
{door === "start" && } {door === "vibe" && } {door === "konstitution" && } {door === "maschinenraum" && }
) }