import { Viewer, DocumentGate } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { SelectionLayer, selectionPlugin } from '@embedpdf/react/selection'; import { interactionPlugin } from '@embedpdf/react/interaction'; import { AnnotationLayer, annotationKey, annotationPlugin, useComments, useCommentThreads, type CommentThreadView, } from '@embedpdf/react/annotation'; import { cloudEngine } from '@cloudpdf/engine'; import './review.css'; const engine = cloudEngine(); const plugins = [ stagePlugin(), renderPlugin(), interactionPlugin(), selectionPlugin(), annotationPlugin(), ]; const proposal: OpenInput = { kind: 'grant', grant: 'shr_qnqHtCNRpzz-s7DPFBIbuOAF' }; // A thread's verdict, its check mark, and the buttons the user may use. function Review({ thread }: { thread: CommentThreadView }) { const comments = useComments(); const ref = thread.root.ref; const verdict = thread.review.lastChange?.state ?? 'none'; const marked = thread.review.markedBy.length > 0; return (

{thread.root.author} {thread.root.contents}

{verdict} {marked && ✓ checked off}

); } function Reviews() { const threads = useCommentThreads(); return (
{threads.length === 0 &&

No comments

} {threads.map((thread) => ( ))}
); } export default function App() { return ( Loading…

}>
{() => ( <> )}
); }