import { AnimatePresence, motion } from "framer-motion"; import { Activity, Brain, Cpu, Database, Globe2, Layers, Radio, Shield, Sparkles, X } from "lucide-react"; import { useState } from "react"; import { toast } from "@/hooks/use-toast"; import { cn } from "@/lib/utils"; interface ModuleDrawerProps { open: boolean; onClose: () => void; } const CATEGORIES = ["Core", "Intelligence", "Network", "Ops"] as const; interface Module { id: string; name: string; category: typeof CATEGORIES[number]; icon: typeof Activity; desc: string; status: "online" | "idle" | "syncing"; } const MODULES: Module[] = [ { id: "cortex", name: "Cortex", category: "Intelligence", icon: Brain, desc: "Reasoning + planning core", status: "online" }, { id: "synapse", name: "Synapse", category: "Intelligence", icon: Sparkles, desc: "Memory & retrieval graph", status: "online" }, { id: "compute", name: "Compute", category: "Core", icon: Cpu, desc: "Scheduler & GPU pool", status: "idle" }, { id: "vault", name: "Vault", category: "Core", icon: Database, desc: "Encrypted state store", status: "online" }, { id: "mesh", name: "Mesh", category: "Network", icon: Globe2, desc: "Edge orchestration", status: "syncing" }, { id: "relay", name: "Relay", category: "Network", icon: Radio, desc: "Live signal channel", status: "online" }, { id: "shield", name: "Shield", category: "Ops", icon: Shield, desc: "Policy & access guard", status: "online" }, { id: "pulse", name: "Pulse", category: "Ops", icon: Activity, desc: "Realtime telemetry", status: "online" }, { id: "layers", name: "Layers", category: "Ops", icon: Layers, desc: "Deployment matrix", status: "idle" }, ]; export function ModuleDrawer({ open, onClose }: ModuleDrawerProps) { const [active, setActive] = useState("All"); const list = active === "All" ? MODULES : MODULES.filter(m => m.category === active); return ( {open && ( <>

Modules

Operating system surface

{(["All", ...CATEGORIES] as const).map(c => ( ))}
{list.map((m, i) => ( { toast({ title: `${m.name} launched`, description: m.desc }); }} className="group text-left p-4 rounded-2xl glass hover:border-primary/40 hover:bg-primary/5 transition-all duration-300 ease-cinematic" >
{m.name}
{m.desc}
))}
)}
); } function StatusDot({ status }: { status: Module["status"] }) { const color = status === "online" ? "bg-emerald-400" : status === "syncing" ? "bg-amber-400" : "bg-muted-foreground/40"; return ( {status} ); }