mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-27 14:49:23 +00:00
36 lines
639 B
TypeScript
36 lines
639 B
TypeScript
![]() |
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>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default ErrorNotification;
|