mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
c6f198b3a2
Remove Rich Text survey GitOrigin-RevId: 97003dfb70b8f9cc9118be3f291c7d56d2508f63
42 lines
1.3 KiB
JavaScript
42 lines
1.3 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'
|
|
import { PdfPreviewMessages } from './pdf-preview-messages'
|
|
import CompileTimeWarning from './compile-time-warning'
|
|
|
|
function PdfPreviewPane() {
|
|
const { pdfUrl } = useCompileContext()
|
|
const classes = classNames('pdf', 'full-size', {
|
|
'pdf-empty': !pdfUrl,
|
|
})
|
|
return (
|
|
<div className={classes}>
|
|
<PdfHybridPreviewToolbar />
|
|
<PdfPreviewMessages>
|
|
<CompileTimeWarning />
|
|
</PdfPreviewMessages>
|
|
<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)
|