2021-09-30 07:29:25 -04:00
|
|
|
import { memo, Suspense } from 'react'
|
|
|
|
import PdfLogsViewer from './pdf-logs-viewer'
|
|
|
|
import PdfViewer from './pdf-viewer'
|
|
|
|
import { usePdfPreviewContext } from '../contexts/pdf-preview-context'
|
|
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
|
|
|
import PdfPreviewToolbar from './pdf-preview-toolbar'
|
2021-09-03 05:06:28 -04:00
|
|
|
|
|
|
|
function PdfPreviewPane() {
|
2021-09-30 07:29:25 -04:00
|
|
|
const { showLogs } = usePdfPreviewContext()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="pdf full-size">
|
|
|
|
<PdfPreviewToolbar />
|
|
|
|
<Suspense fallback={<div>Loading…</div>}>
|
|
|
|
<div className="pdf-viewer">
|
|
|
|
<PdfViewer />
|
|
|
|
</div>
|
|
|
|
</Suspense>
|
|
|
|
{showLogs && <PdfLogsViewer />}
|
|
|
|
</div>
|
|
|
|
)
|
2021-09-03 05:06:28 -04:00
|
|
|
}
|
|
|
|
|
2021-09-30 07:29:25 -04:00
|
|
|
export default memo(withErrorBoundary(PdfPreviewPane))
|