import { useHive } from "../store"; import { selectFleet, selectProject, setActiveTab, setTheme } from "../store/raw"; // Hand-drawn inline nav icons (16×16, stroke currentColor 1.5), per the design // spec's "small hand-drawn inline SVGs" — a 2×2 grid, two bars, a pulse line, // a doc, a dollar sign. function NavIcon({ name }: { name: string }) { const p: Record = { overview: (<> ), sessions: (<>), agents: (<>), activity: (), plans: (<>), cost: (<>), settings: (<>), }; return ( {p[name]} ); } // The pi-hive orbit mark: ring + center dot + 3 satellites, all --brand. function OrbitMark() { return ( ); } export default function Sidebar() { const scope = useHive((s) => s.scope); const activeTab = useHive((s) => s.activeTab); const connection = useHive((s) => s.connection); const theme = useHive((s) => s.theme); const projectGroups = useHive((s) => s.projectGroups); const scopedStats = useHive((s) => s.scopedStats); const scopedEvents = useHive((s) => s.scopedEvents); const scopedAgentCount = useHive((s) => s.scopedAgentCount); const scopeValue = scope.level === "fleet" ? "__fleet" : scope.project; const live = connection === "live"; const currentGroup = scope.level !== "fleet" ? projectGroups.find((g) => g.name === scope.project) : undefined; const projectLabel = scope.level === "fleet" ? "All projects" : (currentGroup?.label || scope.project); // Settings is project-scoped: only shown when a specific project is selected. const projectSelected = scope.level !== "fleet"; const nav = [ { id: "overview", label: "Overview", count: "" }, { id: "sessions", label: "Sessions", count: scopedStats.sessions ? String(scopedStats.sessions) : "" }, { id: "agents", label: "Agents", count: scopedAgentCount ? String(scopedAgentCount) : "" }, { id: "activity", label: "Activity", count: scopedEvents.length ? String(scopedEvents.length) : "" }, { id: "plans", label: "Plans", count: "" }, { id: "cost", label: "Cost", count: "" }, ...(projectSelected ? [{ id: "settings", label: "Settings", count: "" }] : []), ]; function chooseProject(value: string) { if (value === "__fleet") selectFleet(); else selectProject(value); } const host = typeof window !== "undefined" ? window.location.host : "127.0.0.1"; return ( ); }