import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
import { ArrowDown } from '../_utils/components';
import ButtonGroup from '../button/button-group';
import Button from '../button/button';
import Dropdown from '../dropdown';
var SplitButton = function (props) {
    var _a = props.size, size = _a === void 0 ? 'md' : _a, _b = props.btnType, btnType = _b === void 0 ? 'default' : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, _d = props.loading, loading = _d === void 0 ? false : _d, _e = props.dropdownPlacement, dropdownPlacement = _e === void 0 ? 'bottom-end' : _e, _f = props.dropdownTrigger, dropdownTrigger = _f === void 0 ? 'hover' : _f, onClick = props.onClick, overlay = props.overlay, className = props.className, children = props.children, customisedCls = props.prefixCls, otherProps = __rest(props, ["size", "btnType", "disabled", "loading", "dropdownPlacement", "dropdownTrigger", "onClick", "overlay", "className", "children", "prefixCls"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('split-button', configContext.prefixCls, customisedCls);
    var cls = classNames(prefixCls, className);
    return (React.createElement(ButtonGroup, __assign({}, otherProps, { className: cls, btnType: btnType, disabled: disabled, size: size }),
        React.createElement(Button, { onClick: onClick, loading: loading }, children),
        React.createElement(Dropdown, { overlay: overlay, trigger: dropdownTrigger, placement: dropdownPlacement },
            React.createElement(Button, { className: prefixCls + "__dropdown-btn", btnType: btnType, disabled: disabled, size: size },
                React.createElement(ArrowDown, { size: 10 })))));
};
SplitButton.displayName = 'SplitButton';
export default SplitButton;
//# sourceMappingURL=index.js.map