import { useState } from 'react'; 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 { interactionPlugin } from '@embedpdf/react/interaction'; import { commandsPlugin, standardCommands, useCommand, useCommands, } from '@embedpdf/react/commands'; import { cloudEngine } from '@cloudpdf/engine'; import './palette.css'; const engine = cloudEngine(); const plugins = [ stagePlugin(), renderPlugin(), interactionPlugin(), commandsPlugin({ commands: standardCommands }), ]; const welcome: OpenInput = { kind: 'grant', grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }; // A result: its row follows the command, so it greys out the moment the command can't run. function Result({ id }: { id: string }) { const command = useCommand(id); if (!command.visible) return null; return (