This repository has been archived on 2025-05-09. You can view files and clone it, but cannot push or open issues or pull requests.
EvoCalculator/src/client/Elements/Notification.ts
2021-06-07 10:49:26 +03:00

28 lines
571 B
TypeScript

import { notification } from 'antd';
import { NOTIFICATION_DEBOUNCE } from 'core/constants/debounce';
import { debounce } from 'lodash';
type TNotification = 'success' | 'info' | 'warning' | 'error';
export const openNotification = ({
type,
title,
description,
}: {
type: TNotification;
title: string;
description: string;
}) =>
debounce(
() =>
notification[type]({
message: title,
description,
placement: 'bottomRight',
style: {
zIndex: 9999999999,
},
}),
NOTIFICATION_DEBOUNCE,
);