page.tsx19 lines · main
1import { apiJson } from '@/lib/api';
2import { apiOrigin } from '@/lib/env';
3
4import { OverviewDashboard, type Overview } from './overview-client';
5
6export const metadata = { title: 'overview · admin' };
7export const dynamic = 'force-dynamic';
8
9/**
10 * Admin overview — thin server shell. Fetches the first payload server-side
11 * (instant paint, cookies forwarded by apiFetch) and hands off to the
12 * client dashboard, which keeps it live by re-polling /v1/admin/overview
13 * every 10s with credentials — the same api-origin pattern the mcp page's
14 * client controls use.
15 */
16export default async function AdminOverviewPage() {
17 const initial = await apiJson<Overview>('/v1/admin/overview').catch(() => null);
18 return <OverviewDashboard apiOrigin={apiOrigin} initial={initial} />;
19}