import { Component } from '@angular/core'; import { AnnotationToken } from '@embedpdf/angular/annotation'; import { standardCommands, withCommands } from '@embedpdf/angular/commands'; import { DocumentsToken, provideEmbedPdf } from '@embedpdf/angular/runtime'; import { engine } from './pdf'; import { approveDocument } from './review'; @Component({ selector: 'app-document-viewer', providers: [ provideEmbedPdf( { engine }, /* … */ withCommands({ commands: [ ...standardCommands, { id: 'review:approve', label: 'Approve', icon: 'check', shortcut: 'Mod+Enter', enabled: ({ get }) => get(AnnotationToken).canCreate(), run: ({ get }) => approveDocument(get(DocumentsToken)), }, ], }), ), ], template: ``, }) export class DocumentViewer {}