import { useTranslation } from 'react-i18next' import { OLModal, OLModalBody, OLModalFooter, OLModalHeader, OLModalTitle, } from '@/shared/components/ol/ol-modal' import OLButton from '@/shared/components/ol/ol-button' import { useEffect, useState } from 'react' import { useFeatureFlag } from '@/shared/context/split-test-context' function ProjectConvertedFromDocumentModal() { const [convertedFrom, setConvertedFrom] = useState(null) useEffect(() => { const queryString = new URLSearchParams(window.location.search) const from = queryString.get('converted-from') if (from) { setConvertedFrom(from) // Clean the URL immediately so a refresh doesn't trigger the modal again, // but preserve other search params and the hash. const url = new URL(window.location.href) url.searchParams.delete('converted-from') window.history.replaceState(window.history.state, '', url.toString()) } }, []) return ( <> {convertedFrom && ( { setConvertedFrom(null) }} /> )} ) } function ProjectConvertedFromImportModalContent({ onHide, }: { onHide: () => void }) { const { t } = useTranslation() const themed = useFeatureFlag('themed-modals') return ( {t('document_ready_for_editing')} {t('weve_converted_your_content_to_latex')} {t('start_editing')} ) } export default ProjectConvertedFromDocumentModal