28 lines
571 B
TypeScript
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,
|
|
);
|