mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
d905863002
Create a generic ErrorBoundaryFallback component GitOrigin-RevId: 0c9200ddef2be3b90030a32eb8c36a59047cf2b4
18 lines
653 B
JavaScript
18 lines
653 B
JavaScript
import PdfPreviewPane from './pdf-preview-pane'
|
|
import useCompileTriggers from '../hooks/use-compile-triggers'
|
|
import { memo } from 'react'
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
|
import PdfPreviewErrorBoundaryFallback from './pdf-preview-error-boundary-fallback'
|
|
import { useLayoutContext } from '../../../shared/context/layout-context'
|
|
|
|
function PdfPreview() {
|
|
useCompileTriggers()
|
|
|
|
const { detachRole } = useLayoutContext()
|
|
if (detachRole === 'detacher') return null
|
|
return <PdfPreviewPane />
|
|
}
|
|
|
|
export default withErrorBoundary(memo(PdfPreview), () => (
|
|
<PdfPreviewErrorBoundaryFallback type="preview" />
|
|
))
|