2021-09-30 11:29:25 +00:00
|
|
|
import PdfPreviewPane from './pdf-preview-pane'
|
2021-11-30 14:54:14 +00:00
|
|
|
import useCompileTriggers from '../hooks/use-compile-triggers'
|
2021-09-30 11:29:25 +00:00
|
|
|
import { memo } from 'react'
|
2021-10-06 08:33:24 +00:00
|
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
2022-08-09 13:48:59 +00:00
|
|
|
import PdfPreviewErrorBoundaryFallback from './pdf-preview-error-boundary-fallback'
|
2022-07-18 10:24:14 +00:00
|
|
|
import { useLayoutContext } from '../../../shared/context/layout-context'
|
2021-09-30 11:29:25 +00:00
|
|
|
|
|
|
|
function PdfPreview() {
|
2021-11-30 14:54:14 +00:00
|
|
|
useCompileTriggers()
|
2022-07-18 10:24:14 +00:00
|
|
|
|
|
|
|
const { detachRole } = useLayoutContext()
|
|
|
|
if (detachRole === 'detacher') return null
|
2021-10-15 09:39:56 +00:00
|
|
|
return <PdfPreviewPane />
|
2021-09-30 11:29:25 +00:00
|
|
|
}
|
|
|
|
|
2021-10-06 08:33:24 +00:00
|
|
|
export default withErrorBoundary(memo(PdfPreview), () => (
|
2022-08-09 13:48:59 +00:00
|
|
|
<PdfPreviewErrorBoundaryFallback type="preview" />
|
2021-10-06 08:33:24 +00:00
|
|
|
))
|