2025-07-16 17:53:50 +01:00
|
|
|
import { Notification } from '@mantine/core';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
|
|
export interface ErrorNotificationProps {
|
|
|
|
|
error: string | null;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
title?: string;
|
|
|
|
|
color?: string;
|
|
|
|
|
mb?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ErrorNotification = ({
|
|
|
|
|
error,
|
|
|
|
|
onClose,
|
|
|
|
|
title,
|
|
|
|
|
color = 'red',
|
|
|
|
|
mb = 'md'
|
|
|
|
|
}: ErrorNotificationProps) => {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
if (!error) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Notification
|
|
|
|
|
color={color}
|
|
|
|
|
title={title || t("error._value", "Error")}
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
mb={mb}
|
|
|
|
|
>
|
|
|
|
|
{error}
|
|
|
|
|
</Notification>
|
|
|
|
|
);
|
2025-09-29 13:55:53 +02:00
|
|
|
};
|
2025-07-16 17:53:50 +01:00
|
|
|
|
|
|
|
|
export default ErrorNotification;
|