import PropTypes from 'prop-types' import { Trans, useTranslation } from 'react-i18next' import { ErrorBoundaryFallback } from '../../../shared/components/error-boundary-fallback' function PdfPreviewErrorBoundaryFallback({ type }) { const { t } = useTranslation() const showInfoLink = ( , ]} /> ) switch (type) { case 'pdf': return (

{t('pdf_viewer_error')}

{showInfoLink}

) case 'logs': return (

{t('log_viewer_error')}

{showInfoLink}

) case 'preview': default: return (

{t('pdf_preview_error')}

{showInfoLink}

) } } PdfPreviewErrorBoundaryFallback.propTypes = { type: PropTypes.oneOf(['preview', 'pdf', 'logs']).isRequired, } export default PdfPreviewErrorBoundaryFallback