Files
Stirling-PDF/frontend/src/components/tools/shared/ErrorNotification.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
640 B
TypeScript
Raw Normal View History

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-07-16 17:53:50 +01:00
export default ErrorNotification;