import { toast } from 'react-toastify';
import { NotificationVariantTypes } from './constants';
import { NOTIFICATION_VARIANT } from './NotificationTemplate/constants';
import { getClassNameModifierByVariant } from './utils';
export const notify = {
    success: (title, { icon, ...options } = {}) => toast(({ toastProps }) => NOTIFICATION_VARIANT.success({ ...options, icon, title }, toastProps), {
        className: getClassNameModifierByVariant(NotificationVariantTypes.Success, options.hideProgressBar),
        ...options,
    }),
    info: (title, { icon, ...options } = {}) => toast(({ toastProps }) => NOTIFICATION_VARIANT.info({ ...options, icon, title }, toastProps), {
        className: getClassNameModifierByVariant(NotificationVariantTypes.Info, options.hideProgressBar),
        ...options,
    }),
    warning: (title, { icon, ...options } = {}) => toast(({ toastProps }) => NOTIFICATION_VARIANT.warning({ ...options, icon, title }, toastProps), {
        className: getClassNameModifierByVariant(NotificationVariantTypes.Warning, options.hideProgressBar),
        ...options,
    }),
    error: (title, { icon, ...options } = {}) => toast(({ toastProps }) => NOTIFICATION_VARIANT.error({ ...options, icon, title }, toastProps), {
        className: getClassNameModifierByVariant(NotificationVariantTypes.Error, options.hideProgressBar),
        ...options,
    }),
    custom: toast,
    dismiss: toast.dismiss,
    update: toast.update,
    done: toast.done,
};
