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>
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import type { DocumentDetail, DocumentPage } from "@/lib/documents/types";
|
|
|
|
// Renders a document's extracted text: per-page when page data is available,
|
|
// otherwise the flat extracted_text blob, with failed/empty fallbacks.
|
|
|
|
interface ExtractedTextProps {
|
|
doc: DocumentDetail;
|
|
pages: DocumentPage[];
|
|
}
|
|
|
|
export function ExtractedText({ doc, pages }: ExtractedTextProps) {
|
|
return (
|
|
<div className="mt-6 bg-white border border-ink/15 rounded-lg overflow-hidden">
|
|
<div className="px-5 py-3 border-b border-ink/15">
|
|
<h2 className="text-sm font-medium text-ink/70">Extracted text</h2>
|
|
</div>
|
|
{doc.status === "failed" ? (
|
|
<div className="px-5 py-8 text-center text-sm text-ink/40">
|
|
Text extraction failed for this document.
|
|
</div>
|
|
) : !doc.extracted_text ? (
|
|
<div className="px-5 py-8 text-center text-sm text-ink/40">
|
|
No extracted text yet.
|
|
</div>
|
|
) : pages.length > 0 ? (
|
|
<div className="divide-y divide-ink/10">
|
|
{pages.map((pg) => (
|
|
<div key={pg.page_number} className="px-5 py-4">
|
|
<div className="text-xs text-ink/35 mb-2">Page {pg.page_number}</div>
|
|
<pre className="whitespace-pre-wrap break-words font-mono text-sm text-ink/80">
|
|
{pg.text}
|
|
</pre>
|
|
</div>
|
|
))}
|
|
</div>
|
|
) : (
|
|
<div className="px-5 py-4">
|
|
<pre className="whitespace-pre-wrap break-words font-mono text-sm text-ink/80">
|
|
{doc.extracted_text}
|
|
</pre>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|