2021-09-30 07:29:25 -04:00
|
|
|
import { memo, Suspense } from 'react'
|
|
|
|
import PdfLogsViewer from './pdf-logs-viewer'
|
|
|
|
import PdfViewer from './pdf-viewer'
|
2021-10-06 04:33:24 -04:00
|
|
|
import LoadingSpinner from '../../../shared/components/loading-spinner'
|
2021-10-12 04:47:46 -04:00
|
|
|
import PdfHybridPreviewToolbar from './pdf-preview-hybrid-toolbar'
|
|
|
|
import PdfPreviewToolbar from './pdf-preview-toolbar'
|
|
|
|
|
|
|
|
const newPreviewToolbar = new URLSearchParams(window.location.search).has(
|
|
|
|
'new_preview_toolbar'
|
|
|
|
)
|
2021-09-03 05:06:28 -04:00
|
|
|
|
|
|
|
function PdfPreviewPane() {
|
2021-09-30 07:29:25 -04:00
|
|
|
return (
|
|
|
|
<div className="pdf full-size">
|
2021-10-12 04:47:46 -04:00
|
|
|
{newPreviewToolbar ? <PdfPreviewToolbar /> : <PdfHybridPreviewToolbar />}
|
2021-10-06 04:33:24 -04:00
|
|
|
<Suspense fallback={<LoadingPreview />}>
|
2021-09-30 07:29:25 -04:00
|
|
|
<div className="pdf-viewer">
|
|
|
|
<PdfViewer />
|
|
|
|
</div>
|
|
|
|
</Suspense>
|
2021-10-15 05:39:56 -04:00
|
|
|
<PdfLogsViewer />
|
2021-09-30 07:29:25 -04:00
|
|
|
</div>
|
|
|
|
)
|
2021-09-03 05:06:28 -04:00
|
|
|
}
|
|
|
|
|
2021-10-06 04:33:24 -04:00
|
|
|
function LoadingPreview() {
|
|
|
|
return (
|
|
|
|
<div className="pdf-loading-spinner-container">
|
|
|
|
<LoadingSpinner />
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(PdfPreviewPane)
|