2026-02-28 20:42:40 +00:00
|
|
|
import { useShallow } from "zustand/react/shallow";
|
2026-02-27 04:29:51 +00:00
|
|
|
import { useAppState } from "../../store/appState";
|
|
|
|
|
import ProjectList from "../projects/ProjectList";
|
2026-03-04 08:57:12 -08:00
|
|
|
import McpPanel from "../mcp/McpPanel";
|
2026-02-27 04:29:51 +00:00
|
|
|
import SettingsPanel from "../settings/SettingsPanel";
|
|
|
|
|
|
|
|
|
|
export default function Sidebar() {
|
2026-02-28 20:42:40 +00:00
|
|
|
const { sidebarView, setSidebarView } = useAppState(
|
|
|
|
|
useShallow(s => ({ sidebarView: s.sidebarView, setSidebarView: s.setSidebarView }))
|
|
|
|
|
);
|
2026-02-27 04:29:51 +00:00
|
|
|
|
2026-03-04 08:57:12 -08:00
|
|
|
const tabCls = (view: typeof sidebarView) =>
|
|
|
|
|
`flex-1 px-3 py-2 text-sm font-medium transition-colors ${
|
|
|
|
|
sidebarView === view
|
|
|
|
|
? "text-[var(--accent)] border-b-2 border-[var(--accent)]"
|
|
|
|
|
: "text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
|
|
|
|
|
}`;
|
|
|
|
|
|
2026-02-27 04:29:51 +00:00
|
|
|
return (
|
2026-02-27 10:31:27 -08:00
|
|
|
<div className="flex flex-col h-full w-[25%] min-w-56 max-w-80 bg-[var(--bg-secondary)] border border-[var(--border-color)] rounded-lg overflow-hidden">
|
2026-02-27 04:29:51 +00:00
|
|
|
{/* Nav tabs */}
|
|
|
|
|
<div className="flex border-b border-[var(--border-color)]">
|
2026-03-04 08:57:12 -08:00
|
|
|
<button onClick={() => setSidebarView("projects")} className={tabCls("projects")}>
|
2026-02-27 04:29:51 +00:00
|
|
|
Projects
|
|
|
|
|
</button>
|
2026-03-04 08:57:12 -08:00
|
|
|
<button onClick={() => setSidebarView("mcp")} className={tabCls("mcp")}>
|
|
|
|
|
MCP
|
|
|
|
|
</button>
|
|
|
|
|
<button onClick={() => setSidebarView("settings")} className={tabCls("settings")}>
|
2026-02-27 04:29:51 +00:00
|
|
|
Settings
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Content */}
|
2026-02-28 22:53:30 +00:00
|
|
|
<div className="flex-1 overflow-y-auto overflow-x-hidden p-1 min-w-0">
|
2026-03-04 08:57:12 -08:00
|
|
|
{sidebarView === "projects" ? (
|
|
|
|
|
<ProjectList />
|
|
|
|
|
) : sidebarView === "mcp" ? (
|
|
|
|
|
<McpPanel />
|
|
|
|
|
) : (
|
|
|
|
|
<SettingsPanel />
|
|
|
|
|
)}
|
2026-02-27 04:29:51 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|