"use client"; import { useEffect } from "react"; import { useCeoOverview, useAuditorFlags, useRecentActivity, } from "@/hooks/use-dashboard"; import { useTasks } from "@/hooks/use-tasks"; import { usePageRefresh } from "@/hooks"; import { TeamHealthCards } from "./team-health-cards"; import { KeyMetricsPanel } from "./key-metrics-panel"; import { AuditorAlertsPanel } from "./auditor-alerts-panel"; import { ActiveBlockersPanel } from "./active-blockers-panel"; import { RecentActivityFeed } from "./recent-activity-feed"; import { QuickActionsBar } from "./quick-actions-bar"; import { CeoApprovalQueue } from "./ceo-approval-queue"; import { PrReviewQueue } from "./pr-review-queue"; import { ReleaseProposalCard } from "./release-proposal-card"; import { PlaybookReviewQueue } from "./playbook-review-queue"; import { SocialSummaryCard } from "./social-summary-card"; import { RoadmapReviewQueue } from "./roadmap-review-queue"; import { StrategySignalsPanel } from "./strategy-signals-panel"; import type { Activity } from "./activity-item"; import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { UsageOverviewPanel } from "./usage-overview-panel"; import { ScorecardOverviewPanel } from "./scorecard-overview-panel"; import { Settings, AlertCircle } from "lucide-react"; import Link from "next/link"; export function CommandCenter() { const { data: overview, isLoading: loadingOverview, isError: errorOverview, refetch: refetchOverview, } = useCeoOverview(); const { data: flags, isLoading: loadingFlags, isError: errorFlags, refetch: refetchFlags, } = useAuditorFlags({ resolved: false }); const { data: tasks, isLoading: loadingTasks, isError: errorTasks, refetch: refetchTasks, } = useTasks(); const { data: activity, isLoading: loadingActivity, isError: errorActivity, refetch: refetchActivity, } = useRecentActivity(24); const { register, unregister } = usePageRefresh(); useEffect(() => { const callbacks = [ () => { void refetchOverview(); }, () => { void refetchFlags(); }, () => { void refetchTasks(); }, () => { void refetchActivity(); }, ]; callbacks.forEach((cb) => register(cb)); return () => { callbacks.forEach((cb) => unregister(cb)); }; }, [ register, unregister, refetchOverview, refetchFlags, refetchTasks, refetchActivity, ]); const hasError = errorOverview || errorFlags || errorTasks || errorActivity; return ( // flex-col + explicit `order` (reset via md:order-none): below md the CEO // decision queues and activity move above the fold; at md+ every item // shares order:0 and falls back to plain source order (unchanged desktop // layout).
{/* Header */}

RoboCo Command Center

Complete visibility into all operations

Open settings
{/* Error indicator */} {hasError && (
Some data failed to load. Use the header refresh button to try again.
)} {/* CEO Approval Queue + Strategy Signals - side-by-side on lg+. Ordered first on mobile — the CEO's decisions shouldn't be below the fold. */}
{/* External-PR review decision queue (hidden when empty) */}
{/* Gated release proposal (hidden when none open) */}
{/* Playbook review queue (hidden when no drafts) */}
{/* Social (X + video) summary — the full queues + unified history live on /social, avoiding a duplicated surface here. */}
{/* Board roadmap queue (hidden when no cycle authored) */}
{/* Blockers and Activity Row — activity brought up near the top on mobile too, ahead of the Team Health / Quick Actions filler. */}
{/* Team Health */}

Team Health

{/* Quick Actions */}

Quick Actions

{/* Metrics, Alerts, Usage, and Performance Row */}
); }