import { useTranslation } from 'react-i18next' 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 (
{t('error')}: {error.message}
) } return (
{t('generic_something_went_wrong')}
) }