import { useState } from 'react'; import { Viewer, DocumentGate, useDocuments, useDocumentsState, type DocumentInfo, type FailedDocumentInfo, } 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 { cloudEngine } from '@cloudpdf/engine'; import './states.css'; const engine = cloudEngine(); const plugins = [stagePlugin(), renderPlugin()]; const welcome: OpenInput = { kind: 'grant', grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }; // A file that isn't a PDF, so its document can't be opened. const broken: OpenInput = { kind: 'bytes', bytes: new TextEncoder().encode('Not a PDF') }; function Tabs() { const documents = useDocuments(); const { documents: open, activeId } = useDocumentsState(); return (
That password isn’t right. Try again.
}{document.error.message}