"use strict";
/**
 * @desc 通知
 * @author denghuan
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const antd_1 = require("antd");
const classnames_1 = __importDefault(require("classnames"));
const { open, info, success, warning, error, ...others } = antd_1.notification;
function notifFuncDecorator(func, cls) {
    return (args) => {
        const { className, title, subtitle, ...others } = args;
        return func({
            message: (title || subtitle) && (react_1.default.createElement("div", null,
                react_1.default.createElement("div", { className: "title" }, title),
                react_1.default.createElement("div", { className: "subtitle" }, subtitle))),
            className: classnames_1.default(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,
};
exports.default = notification;
