mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 05:00:06 +02:00

[web] BS5 Group members management GitOrigin-RevId: fab24ee6f6de07aa64887e123df930593fcec6a2
31 lines
599 B
TypeScript
31 lines
599 B
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import OLNotification from '@/features/ui/components/ol/ol-notification'
|
|
|
|
export type APIError = {
|
|
message?: string
|
|
}
|
|
|
|
type ErrorAlertProps = {
|
|
error?: APIError
|
|
}
|
|
|
|
export default function ErrorAlert({ error }: ErrorAlertProps) {
|
|
const { t } = useTranslation()
|
|
|
|
if (!error) {
|
|
return null
|
|
}
|
|
|
|
if (error.message) {
|
|
return (
|
|
<OLNotification
|
|
type="error"
|
|
content={`${t('error')}: ${error.message}`}
|
|
/>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<OLNotification type="error" content={t('generic_something_went_wrong')} />
|
|
)
|
|
}
|