"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const EllipsisOutlined_1 = tslib_1.__importDefault(require("@ant-design/icons/EllipsisOutlined"));
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const React = tslib_1.__importStar(require("react"));
const button_1 = require("../button");
const dropdown_1 = tslib_1.__importDefault(require("./dropdown"));
const DropdownButton = (props) => {
    var _a;
    const { prefixCls: customizePrefixCls, type = 'primary', size = 'default', danger, disabled, loading, onClick, htmlType, children, className, overlay, trigger, align, visible, onVisibleChange, placement, getPopupContainer, href, icon = React.createElement(EllipsisOutlined_1.default, null), title, buttonsRender = (buttons) => buttons, mouseEnterDelay, mouseLeaveDelay, overlayClassName, overlayStyle, ...restProps } = props;
    const prefixCls = customizePrefixCls || 'kt-dropdown-button';
    const dropdownProps = {
        align,
        overlay,
        disabled,
        trigger: disabled ? [] : trigger,
        getPopupContainer,
        mouseEnterDelay,
        mouseLeaveDelay,
        overlayClassName,
        overlayStyle,
    };
    dropdownProps.placement = (_a = props === null || props === void 0 ? void 0 : props.placement) !== null && _a !== void 0 ? _a : 'bottomRight';
    const leftButton = (React.createElement(button_1.Button, { size: size, type: type, disabled: disabled, loading: loading, onClick: onClick, htmlType: htmlType, title: title }, children));
    const rightButton = (React.createElement(button_1.Button, { size: size, type: type }, icon !== null && icon !== void 0 ? icon : React.createElement(EllipsisOutlined_1.default, null)));
    const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
    return (React.createElement("div", { ...restProps, className: (0, classnames_1.default)(prefixCls, className) },
        leftButtonToRender,
        React.createElement(dropdown_1.default, { ...dropdownProps }, rightButtonToRender)));
};
exports.default = DropdownButton;
//# sourceMappingURL=dropdown-button.js.map