/**
 * @desc 通知
 * @author denghuan
 */
import React from 'react';
import { notification as _notification } from 'antd';
import classNames from 'classnames';
const { open, info, success, warning, error, ...others } = _notification;
function notifFuncDecorator(func, cls) {
    return (args) => {
        const { className, title, subtitle, ...others } = args;
        return func({
            message: (title || subtitle) && (React.createElement("div", null,
                React.createElement("div", { className: "title" }, title),
                React.createElement("div", { className: "subtitle" }, subtitle))),
            className: classNames(className, cls),
            ...others,
        });
    };
}
const notification = {
    open: notifFuncDecorator(open),
    info: notifFuncDecorator(info, 'ant-notification-notice-info'),
    success: notifFuncDecorator(success, 'ant-notification-notice-success'),
    warning: notifFuncDecorator(warning, 'ant-notification-notice-warning'),
    error: notifFuncDecorator(error, 'ant-notification-notice-error'),
    ...others,
};
export default notification;
