2022-03-31 07:22:36 -04:00
|
|
|
import ReactDOM from 'react-dom'
|
|
|
|
import PdfPreview from './pdf-preview'
|
2022-05-31 08:06:41 -04:00
|
|
|
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
2024-06-05 04:33:11 -04:00
|
|
|
import { ReactContextRoot } from '@/features/ide-react/context/react-context-root'
|
2022-03-31 07:22:36 -04:00
|
|
|
|
|
|
|
function PdfPreviewDetachedRoot() {
|
2022-05-31 08:06:41 -04:00
|
|
|
const { isReady } = useWaitForI18n()
|
|
|
|
|
|
|
|
if (!isReady) {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
2022-03-31 07:22:36 -04:00
|
|
|
return (
|
2024-06-05 04:33:11 -04:00
|
|
|
<ReactContextRoot>
|
2022-10-17 06:10:38 -04:00
|
|
|
<PdfPreview />
|
2024-06-05 04:33:11 -04:00
|
|
|
</ReactContextRoot>
|
2022-03-31 07:22:36 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PdfPreviewDetachedRoot // for testing
|
|
|
|
|
|
|
|
const element = document.getElementById('pdf-preview-detached-root')
|
|
|
|
if (element) {
|
|
|
|
ReactDOM.render(<PdfPreviewDetachedRoot />, element)
|
|
|
|
}
|