mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 16:23:36 -05:00
bfad0841a4
[web] faster compiles feedback UI GitOrigin-RevId: 9feea47503aa6bddf51adb73b8c9fbef394fda14
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
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'
|
|
import FasterCompilesFeedback from './faster-compiles-feedback'
|
|
|
|
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 />
|
|
<FasterCompilesFeedback />
|
|
</div>
|
|
</Suspense>
|
|
<PdfLogsViewer />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function LoadingPreview() {
|
|
return (
|
|
<div className="pdf-loading-spinner-container">
|
|
<LoadingSpinner delay={500} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default memo(PdfPreviewPane)
|