'use client'; import Link from 'next/link'; import { MetricCard } from '@/components/dashboard/metric-card'; import { SpoonCard } from '@/components/spoons/spoon-card'; import { MaintenanceQueue } from '@/components/updates/maintenance-queue'; import { useQuery } from 'convex/react'; import { Bot, GitBranch, GitPullRequest, RefreshCw, ShieldCheck, } from 'lucide-react'; import { api } from '@spoon/backend/convex/_generated/api.js'; import { Button, Card, CardContent, CardHeader, CardTitle } from '@spoon/ui'; const DashboardPage = () => { const spoons = useQuery(api.spoons.listMine, {}) ?? []; const syncRuns = useQuery(api.syncRuns.listRecent, { limit: 5 }) ?? []; const agentRequests = useQuery(api.agentRequests.listRecent, { limit: 5 }) ?? []; const aiReviews = useQuery(api.aiReviews.listRecent, { limit: 5 }) ?? []; const activeSpoons = spoons.filter( (spoon) => spoon.status === 'active', ).length; const behind = spoons.filter((spoon) => spoon.syncStatus === 'behind').length; const diverged = spoons.filter( (spoon) => spoon.syncStatus === 'diverged', ).length; const openPullRequests = spoons.reduce( (total, spoon) => total + (spoon.upstreamAheadBy ?? 0), 0, ); return (

Dashboard

Monitor managed forks, upstream activity, and queued agent work.

Maintenance queue

Recent Spoons

{spoons.length ? ( spoons .slice(0, 3) .map((spoon) => ) ) : (

No Spoons yet

Create a manual Spoon record to start shaping your fork maintenance dashboard.

)}

Recent activity

Upstream checks {syncRuns.length ? (
{syncRuns.map((run) => (

{run.kind.replaceAll('_', ' ')}

{run.status.replaceAll('_', ' ')}

))}
) : (

Scheduled upstream checks will appear here once provider automation is connected.

)}
AI reviews {aiReviews.length ? (
{aiReviews.map((review) => (

{review.risk} risk

{review.outputSummary ?? review.inputSummary}

))}
) : (

OpenAI compatibility reviews will appear here after you run them on a Spoon.

)}
); }; export default DashboardPage;