papertrail/app/dashboard/_components/DiscrepancyBreakdown.tsx
caelum0x 695a365ae4 feat: PaperTrail — enterprise evidence-verification platform
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>
2026-07-08 07:21:22 +03:00

43 lines
1.5 KiB
TypeScript

import { barClasses, LABELS, type StatsData } from "./dashboardShared";
interface DiscrepancyBreakdownProps {
stats: StatsData;
}
export function DiscrepancyBreakdown({ stats }: DiscrepancyBreakdownProps) {
const entries = Object.entries(stats.by_discrepancy_type);
const maxCount = entries.reduce((max, [, count]) => Math.max(max, count), 0);
return (
<section className="mt-8">
<h2 className="mb-3 text-sm font-medium uppercase tracking-wide text-ink/40">
By discrepancy type
</h2>
{entries.length === 0 ? (
<p className="text-sm text-ink/50">No verifications yet.</p>
) : (
<ul className="flex flex-col gap-3">
{entries
.sort((a, b) => b[1] - a[1])
.map(([type, count]) => (
<li key={type} className="flex items-center gap-3">
<span className="w-48 shrink-0 text-sm text-ink/80">
{LABELS[type] ?? type}
</span>
<div className="h-4 flex-1 rounded bg-ink/5">
<div
className={`h-4 rounded ${barClasses(type)}`}
style={{ width: maxCount > 0 ? `${(count / maxCount) * 100}%` : "0%" }}
/>
</div>
<span className="w-10 shrink-0 text-right text-sm tabular-nums text-ink/60">
{count}
</span>
</li>
))}
</ul>
)}
</section>
);
}