import Link from 'next/link'; import { Section } from '@/components/ui/section'; import { Badge } from '@/components/ui/badge'; import { EmptyState } from '@/components/ui/empty-state'; import { listSnapshots } from '@/lib/queries/rankings'; import { fmtDateTime, fmtInt, scopeLabel } from '@/lib/format'; export default async function AdminRankingsPage() { const snaps = await listSnapshots(300); return (

Ranking snapshots

Every snapshot ever generated (current and superseded). Run `pnpm cix rank` to compute.

{snaps.length ? (
{snaps.map((s) => ( ))}
Id Metric Scope Formula Eligible Rows Current Generated Inputs hash
{s.id} {s.metric_name} {scopeLabel(s.scope_key)} {s.formula_version} {fmtInt(s.eligible_entities)} {fmtInt(s.row_count)} {s.is_current ? current : superseded} {fmtDateTime(s.generated_at)} {s.inputs_hash}
) : ( The ranking engine has not produced any snapshot on this environment. )}
); }