diff --git a/src/client/Elements/Notification.ts b/src/client/Elements/Notification.ts new file mode 100644 index 0000000..e99b02a --- /dev/null +++ b/src/client/Elements/Notification.ts @@ -0,0 +1,27 @@ +import { notification } from 'antd'; +import { throttle } from 'lodash'; + +type TNotification = 'success' | 'info' | 'warning' | 'error'; + +export const openNotification = ({ + type, + title, + description, +}: { + type: TNotification; + title: string; + description: string; +}) => + throttle( + () => + notification[type]({ + message: title, + description, + placement: 'bottomRight', + style: { + zIndex: 9999999999, + }, + }), + 3000, + { trailing: false }, + );