import type { ReactNode } from "react"; import { useShallow } from "zustand/react/shallow"; import { useAppState } from "../../store/appState"; import ProjectList from "../projects/ProjectList"; import McpPanel from "../mcp/McpPanel"; import SettingsPanel from "../settings/SettingsPanel"; type SidebarView = "projects" | "mcp" | "settings"; const RAIL_ICONS: { view: SidebarView; label: string; icon: ReactNode }[] = [ { view: "projects", label: "Projects", icon: ( ), }, { view: "mcp", label: "MCP", icon: ( ), }, { view: "settings", label: "Settings", icon: ( ), }, ]; export default function Sidebar() { const { sidebarView, setSidebarView, sidebarCollapsed, setSidebarCollapsed, toggleSidebarCollapsed } = useAppState( useShallow(s => ({ sidebarView: s.sidebarView, setSidebarView: s.setSidebarView, sidebarCollapsed: s.sidebarCollapsed, setSidebarCollapsed: s.setSidebarCollapsed, toggleSidebarCollapsed: s.toggleSidebarCollapsed, })) ); if (sidebarCollapsed) { const railBtn = (view: SidebarView, label: string, icon: ReactNode) => { const active = sidebarView === view; return ( ); }; return (