mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Add error boundary to the project dashboard list
GitOrigin-RevId: 0f4cc3b4db62efe25ceeff202f305d08ddd73968
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { FC, ReactNode } from 'react'
|
||||
import { Alert } from 'react-bootstrap'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { DefaultMessage } from './default-message'
|
||||
|
||||
export const ErrorBoundaryFallback: FC<{ modal?: ReactNode }> = ({
|
||||
children,
|
||||
@@ -8,14 +8,8 @@ export const ErrorBoundaryFallback: FC<{ modal?: ReactNode }> = ({
|
||||
}) => {
|
||||
return (
|
||||
<div className="error-boundary-alert">
|
||||
<Alert bsStyle="danger">{children || <DefaultContent />}</Alert>
|
||||
<Alert bsStyle="danger">{children || <DefaultMessage />}</Alert>
|
||||
{modal}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const DefaultContent = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return <p>{`${t('generic_something_went_wrong')}. ${t('please_refresh')}`}</p>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user