import { Viewer, DocumentGate } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin, useStage } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { interactionPlugin } from '@embedpdf/react/interaction'; import { FormLayer, formPlugin } from '@embedpdf/react/form'; import type { FieldControl, FieldControlProps } from '@embedpdf/react/form'; import { cloudEngine } from '@cloudpdf/engine'; import './controls.css'; const engine = cloudEngine(); const plugins = [stagePlugin(), renderPlugin(), interactionPlugin(), formPlugin()]; const forms: OpenInput = { kind: 'grant', grant: 'shr_eBRW5E3MpolzD8G36Alp30EF' }; /** A checkbox as a switch. A click fills the field in, as a click on the checkbox would. */ function Switch({ widget, setValue }: FieldControlProps) { if (widget.control !== 'toggle') return null; return ( ); } export default function App() { return ( Loading…

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