"use client"; /** * DocReadingView โ€” toggles between the clean LLM reading version (default) and * the raw extracted chunks. The per-page "ver scan original" stays available * inside the chunks renderer. When no reading version exists, only chunks show. */ import { useState } from "react"; import { MarkdownBody } from "@/components/markdown-body"; import { DocRendererV2 } from "@/components/doc-renderer-v2"; import type { ParsedChunk } from "@/lib/chunks"; type View = "reading" | "chunks"; export function DocReadingView({ docId, reading, chunksByPage, }: { docId: string; reading: string | null; chunksByPage: Array<[number, ParsedChunk[]]>; }) { const [view, setView] = useState(reading ? "reading" : "chunks"); return (
{reading && (
)} {view === "reading" && reading ? (
{reading}
) : ( )}
); }