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