import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["prefixCls", "size", "className"];
import React, { memo, useContext } from 'react';
import classNames from 'classnames';
import { Size } from '../_util/enum';
import ConfigContext from '../config-provider/ConfigContext';

var ButtonGroup = function ButtonGroup(props) {
  var customizePrefixCls = props.prefixCls,
      size = props.size,
      className = props.className,
      others = _objectWithoutProperties(props, _excluded);

  var _useContext = useContext(ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = getPrefixCls('btn-group', customizePrefixCls); // large => lg
  // small => sm

  var sizeCls = '';

  switch (size) {
    case Size.large:
      sizeCls = 'lg';
      break;

    case Size.small:
      sizeCls = 'sm';
      break;

    default:
  }

  var classes = classNames(prefixCls, _defineProperty({}, "".concat(prefixCls, "-").concat(sizeCls), sizeCls), className);
  return /*#__PURE__*/React.createElement("div", _extends({}, others, {
    className: classes
  }));
};

ButtonGroup.displayName = 'ButtonGroup';
export default /*#__PURE__*/memo(ButtonGroup);
//# sourceMappingURL=ButtonGroup.js.map
