"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _enum = require("../_util/enum");

var _ConfigContext = _interopRequireDefault(require("../config-provider/ConfigContext"));

var _excluded = ["prefixCls", "size", "className"];

var ButtonGroup = function ButtonGroup(props) {
  var customizePrefixCls = props.prefixCls,
      size = props.size,
      className = props.className,
      others = (0, _objectWithoutProperties2["default"])(props, _excluded);

  var _useContext = (0, _react.useContext)(_ConfigContext["default"]),
      getPrefixCls = _useContext.getPrefixCls;

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

  var sizeCls = '';

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

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

    default:
  }

  var classes = (0, _classnames["default"])(prefixCls, (0, _defineProperty2["default"])({}, "".concat(prefixCls, "-").concat(sizeCls), sizeCls), className);
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({}, others, {
    className: classes
  }));
};

ButtonGroup.displayName = 'ButtonGroup';

var _default = /*#__PURE__*/(0, _react.memo)(ButtonGroup);

exports["default"] = _default;
//# sourceMappingURL=ButtonGroup.js.map
