import PropTypes from 'prop-types'
import { Alert } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
function ErrorBoundaryFallback({ type }) {
const { t } = useTranslation()
// we create each instance of `` individually so `i18next-scanner` can detect hardcoded `i18nKey` values
let content
if (type === 'pdf') {
content = (
<>
{t('pdf_viewer_error')}
,
]}
/>
>
)
} else if (type === 'logs') {
content = (
<>
{t('log_viewer_error')}
,
]}
/>
>
)
} else {
content = (
<>
{t('pdf_preview_error')}
,
]}
/>
>
)
}
return (
)
}
ErrorBoundaryFallback.propTypes = {
type: PropTypes.oneOf(['preview', 'pdf', 'logs']).isRequired,
}
export default ErrorBoundaryFallback