mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
3c8a9d9863
[web] do not download the pdf in editor only view mode GitOrigin-RevId: 4d8936964540c0820f72abb8c858e86e2e7196e2
18 lines
621 B
JavaScript
18 lines
621 B
JavaScript
import PdfPreviewPane from './pdf-preview-pane'
|
|
import useCompileTriggers from '../hooks/use-compile-triggers'
|
|
import { memo } from 'react'
|
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
|
import ErrorBoundaryFallback from './error-boundary-fallback'
|
|
import { useLayoutContext } from '../../../shared/context/layout-context'
|
|
|
|
function PdfPreview() {
|
|
useCompileTriggers()
|
|
|
|
const { detachRole } = useLayoutContext()
|
|
if (detachRole === 'detacher') return null
|
|
return <PdfPreviewPane />
|
|
}
|
|
|
|
export default withErrorBoundary(memo(PdfPreview), () => (
|
|
<ErrorBoundaryFallback type="preview" />
|
|
))
|