pdf-preview.jsx 566 B

123456789101112131415
  1. import PdfPreviewPane from './pdf-preview-pane'
  2. import { memo } from 'react'
  3. import withErrorBoundary from '../../../infrastructure/error-boundary'
  4. import PdfPreviewErrorBoundaryFallback from './pdf-preview-error-boundary-fallback'
  5. import { useLayoutContext } from '../../../shared/context/layout-context'
  6. function PdfPreview() {
  7. const { detachRole } = useLayoutContext()
  8. if (detachRole === 'detacher') return null
  9. return <PdfPreviewPane />
  10. }
  11. export default withErrorBoundary(memo(PdfPreview), () => (
  12. <PdfPreviewErrorBoundaryFallback type="preview" />
  13. ))