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>
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import { BatchResultItem } from "@/components/BatchResults";
|
|
import { toBatchMarkdownReport } from "@/lib/batchReport";
|
|
|
|
function downloadFile(filename: string, content: string, type: string) {
|
|
const blob = new Blob([content], { type });
|
|
const url = URL.createObjectURL(blob);
|
|
const a = document.createElement("a");
|
|
a.href = url;
|
|
a.download = filename;
|
|
document.body.appendChild(a);
|
|
a.click();
|
|
document.body.removeChild(a);
|
|
URL.revokeObjectURL(url);
|
|
}
|
|
|
|
/**
|
|
* Client-side combined provenance report download for a whole batch run — no server
|
|
* round-trip, no LLM cost. Builds one Markdown citation trail from the already-rendered
|
|
* results, including honest notes for claims with no confident source.
|
|
*/
|
|
export function DownloadBatchReport({ items }: { items: BatchResultItem[] }) {
|
|
return (
|
|
<button
|
|
onClick={() =>
|
|
downloadFile(
|
|
"papertrail-batch-report.md",
|
|
toBatchMarkdownReport(items),
|
|
"text/markdown"
|
|
)
|
|
}
|
|
className="rounded-md border border-ink/15 bg-white px-3 py-1.5 text-sm text-ink/70 hover:bg-ink/5"
|
|
>
|
|
Download batch report (.md)
|
|
</button>
|
|
);
|
|
}
|