mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 05:00:06 +02:00
26 lines
656 B
TypeScript
26 lines
656 B
TypeScript
import { createRoot } from 'react-dom/client'
|
|
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) {
|
|
const root = createRoot(element)
|
|
root.render(<PdfPreviewDetachedRoot />)
|
|
}
|