"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 icon_1 = require("./icon");
const commonModalProps = {
    width: 300,
    centered: true,
};
const _Modal = { ...antd_1.Modal };
function makeProps(props) {
    const { title, className, ...others } = props;
    return {
        title,
        className: title
            ? className
            : classnames_1.default(className, 'ant-modal-confirm-without-title'),
        ...commonModalProps,
        ...others,
    };
}
antd_1.Modal.success = (props) => {
    const { icon = react_1.default.createElement(icon_1.SuccessFilled, null), ...others } = props;
    return _Modal.success(makeProps({ icon, ...others }));
};
antd_1.Modal.error = (props) => {
    const { icon = react_1.default.createElement(icon_1.ErrorFilled, null), ...others } = props;
    return _Modal.error(makeProps({ icon, ...others }));
};
antd_1.Modal.warning = (props) => {
    const { icon = react_1.default.createElement(icon_1.WarningFilled, null), ...others } = props;
    return _Modal.warning(makeProps({ icon, ...others }));
};
antd_1.Modal.confirm = (props) => {
    return _Modal.confirm(makeProps({ width: 482, ...props }));
};
antd_1.Modal.info = (props) => {
    return _Modal.info(makeProps(props));
};
exports.default = antd_1.Modal;
