Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a deterministic verification core: clinical-trial claims checked against ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI recomputed in code, oracle-tested), code-enforced exact-span grounding, and multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing at scale (unpdf + Docling), agentic workflows, Claude Science connector, compliance/audit, billing, public API, and more. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import {
|
|
formatPct,
|
|
labelFor,
|
|
type OverviewMetrics as OverviewMetricsData,
|
|
} from "../client";
|
|
import { BarChart, ChartCard, KpiCard } from "../components";
|
|
|
|
interface OverviewMetricsProps {
|
|
metrics: OverviewMetricsData;
|
|
}
|
|
|
|
// KPI cards + distortion-by-type chart for the analytics overview.
|
|
export function OverviewMetrics({ metrics }: OverviewMetricsProps) {
|
|
return (
|
|
<>
|
|
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
|
<KpiCard
|
|
label="Claims verified"
|
|
value={String(metrics.claimsVerified)}
|
|
hint={`${metrics.totalVerifications} verifications`}
|
|
/>
|
|
<KpiCard
|
|
label="Distortion rate"
|
|
value={formatPct(metrics.distortionRate)}
|
|
hint="Non-accurate outcomes"
|
|
/>
|
|
<KpiCard
|
|
label="Documents processed"
|
|
value={String(metrics.documentsProcessed)}
|
|
/>
|
|
<KpiCard
|
|
label="Avg trust score"
|
|
value={
|
|
metrics.avgTrustScore === null
|
|
? "—"
|
|
: `${metrics.avgTrustScore}/100`
|
|
}
|
|
/>
|
|
</div>
|
|
|
|
<div className="mt-4">
|
|
<ChartCard
|
|
title="Distortion by type"
|
|
description="How this org's verification outcomes break down."
|
|
>
|
|
<BarChart
|
|
data={metrics.distortionByType.map((d) => ({
|
|
label: labelFor(d.type),
|
|
value: d.count,
|
|
suffix: formatPct(d.rate),
|
|
}))}
|
|
emptyMessage="No verification outcomes yet."
|
|
/>
|
|
</ChartCard>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|