import PropTypes from 'prop-types' import { useTranslation, Trans } from 'react-i18next' import PreviewLogsPaneEntry from '../../preview/components/preview-logs-pane-entry' import { memo } from 'react' function PdfPreviewError({ error }) { const { t } = useTranslation() switch (error) { case 'rendering-error': return ( {t('something_went_wrong_rendering_pdf')} ) case 'clsi-maintenance': return ( {t('clsi_maintenance')} ) case 'clsi-unavailable': return ( {t('clsi_unavailable')} ) case 'too-recently-compiled': return ( {t('too_recently_compiled')} ) case 'terminated': return ( {t('compile_terminated_by_user')} ) case 'rate-limited': return ( {t('project_flagged_too_many_compiles')} ) case 'compile-in-progress': return ( {t('pdf_compile_try_again')} ) case 'auto-compile-disabled': return ( {t('autocompile_disabled_reason')} ) case 'project-too-large': return ( {t('project_too_much_editable_text')} ) case 'timedout': return ( {t('proj_timed_out_reason')}
{t('learn_how_to_make_documents_compile_quickly')}
) case 'failure': return ( {t('no_pdf_error_explanation')} ) case 'clear-cache': return ( {t('somthing_went_wrong_compiling')} ) case 'validation-problems': return null // handled elsewhere case 'error': default: return ( {t('somthing_went_wrong_compiling')} ) } } PdfPreviewError.propTypes = { error: PropTypes.string.isRequired, } export default memo(PdfPreviewError) function ErrorLogEntry({ title, children }) { const { t } = useTranslation() return ( ) } ErrorLogEntry.propTypes = { title: PropTypes.string.isRequired, children: PropTypes.any.isRequired, }