mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 02:36:47 -05:00
dc6f480843
Changed LoadingSpinner default delay GitOrigin-RevId: 2bf499585e3394e5c6b8ed9583add7ef6f678fc1
35 lines
999 B
JavaScript
35 lines
999 B
JavaScript
import { memo, Suspense } from 'react'
|
|
import classNames from 'classnames'
|
|
import PdfLogsViewer from './pdf-logs-viewer'
|
|
import PdfViewer from './pdf-viewer'
|
|
import LoadingSpinner from '../../../shared/components/loading-spinner'
|
|
import PdfHybridPreviewToolbar from './pdf-preview-hybrid-toolbar'
|
|
import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context'
|
|
|
|
function PdfPreviewPane() {
|
|
const { pdfUrl } = useCompileContext()
|
|
const classes = classNames('pdf', 'full-size', {
|
|
'pdf-empty': !pdfUrl,
|
|
})
|
|
return (
|
|
<div className={classes}>
|
|
<PdfHybridPreviewToolbar />
|
|
<Suspense fallback={<LoadingPreview />}>
|
|
<div className="pdf-viewer">
|
|
<PdfViewer />
|
|
</div>
|
|
</Suspense>
|
|
<PdfLogsViewer />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function LoadingPreview() {
|
|
return (
|
|
<div className="pdf-loading-spinner-container">
|
|
<LoadingSpinner delay={500} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfPreviewPane)
|