function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import { __rest } from "tslib";
import classNames from 'classnames';
import React, { createElement, forwardRef, Children, cloneElement } from "react";
import View from '../view';

var ButtonGroup = function ButtonGroup(props, ref) {
  var _props$prefix = props.prefix,
      prefix = _props$prefix === void 0 ? 'mt-' : _props$prefix,
      size = props.size,
      model = props.model,
      className = props.className,
      children = props.children,
      other = __rest(props, ["prefix", "size", "model", "className", "children"]);

  return /*#__PURE__*/React.createElement(View, _extends({
    className: classNames("".concat(prefix, "button-group"), classNames)
  }, other), Children.map(children, function (child, index) {
    return cloneElement(child, {
      key: "mt_button_".concat(index),
      model: model,
      size: size
    });
  }));
};

export default /*#__PURE__*/forwardRef(ButtonGroup);