mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 01:45:29 -05:00
c24ace801b
GitOrigin-RevId: 7a0d45e17d9905fa75569e2d19ca59caa4a41565
25 lines
621 B
JavaScript
25 lines
621 B
JavaScript
import ReactDOM from 'react-dom'
|
|
import PdfPreview from './pdf-preview'
|
|
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
|
import { ReactContextRoot } from '@/features/ide-react/context/react-context-root'
|
|
|
|
function PdfPreviewDetachedRoot() {
|
|
const { isReady } = useWaitForI18n()
|
|
|
|
if (!isReady) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<ReactContextRoot>
|
|
<PdfPreview />
|
|
</ReactContextRoot>
|
|
)
|
|
}
|
|
|
|
export default PdfPreviewDetachedRoot // for testing
|
|
|
|
const element = document.getElementById('pdf-preview-detached-root')
|
|
if (element) {
|
|
ReactDOM.render(<PdfPreviewDetachedRoot />, element)
|
|
}
|