overleaf/services/web/frontend/js/features/pdf-preview/components/pdf-preview.js
Jakob Ackermann 3c8a9d9863 Merge pull request #8853 from overleaf/jpa-no-pdf-download-in-editor-only-mode
[web] do not download the pdf in editor only view mode

GitOrigin-RevId: 4d8936964540c0820f72abb8c858e86e2e7196e2
2022-07-19 08:03:28 +00:00

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" />
))