/* The Control Center shell: a left nav (Runs / Repositories / Agents / Approvals / Git * Servers / Activity / Shared) and the active section on the right, matching the design's * hub layout. Command feedback and load errors surface as banners at the top of main. */ "use client"; import { useDashboard, type Section } from "@/components/store"; import { RunsSection } from "@/components/sections/RunsSection"; import { RepositoriesSection } from "@/components/sections/RepositoriesSection"; import { AgentsSection } from "@/components/sections/AgentsSection"; import { SchedulesSection } from "@/components/sections/SchedulesSection"; import { ApprovalsSection } from "@/components/sections/ApprovalsSection"; import { GitServersSection } from "@/components/sections/GitServersSection"; import { ActivitySection } from "@/components/sections/ActivitySection"; import { SharedSection } from "@/components/sections/SharedSection"; interface NavDef { key: Section; label: string; count: (s: ReturnType) => number; accent?: (s: ReturnType) => boolean; } const NAV: NavDef[] = [ { key: "runs", label: "Runs", count: (s) => s.agents.length, accent: (s) => s.agents.some((a) => a.status === "paused_for_input"), }, { key: "repositories", label: "Repositories", count: (s) => s.projects.length }, { key: "agents", label: "Agents", count: (s) => s.agents.length }, { key: "schedules", label: "Schedules", count: (s) => s.schedules.length }, { key: "approvals", label: "Approvals", count: (s) => s.approvals.length }, { key: "servers", label: "Git Servers", count: (s) => s.hosts.length }, { key: "activity", label: "Activity", count: (s) => s.commands.length }, { key: "shared", label: "Shared", count: (s) => s.shared.context.length }, ]; export function Dashboard({ onSignOut }: { onSignOut: () => void }) { const s = useDashboard(); return (
{s.cmd.text && (

{s.cmd.text}

)} {s.lastError && (

{s.lastError}

)} {s.section === "runs" ? ( ) : (
{s.section === "repositories" && } {s.section === "agents" && } {s.section === "schedules" && } {s.section === "approvals" && } {s.section === "servers" && } {s.section === "activity" && } {s.section === "shared" && }
)}
); }