'use strict';

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

exports.__esModule = true;
exports.Button = void 0;

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

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Button = _interopRequireDefault(require("react-bootstrap/lib/Button"));

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

var Button =
/*#__PURE__*/
function (_React$Component) {
  (0, _inheritsLoose2.default)(Button, _React$Component);

  function Button() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = Button.prototype;

  _proto.render = function render() {
    var _this$props = this.props,
        withIcon = _this$props.withIcon,
        iconOnly = _this$props.iconOnly,
        className = _this$props.className,
        children = _this$props.children,
        testAutomationId = _this$props.testAutomationId,
        inline = _this$props.inline,
        props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["withIcon", "iconOnly", "className", "children", "testAutomationId", "inline"]);
    var classNames = (0, _classnames.default)(className, {
      'rc-button-icon-only': iconOnly,
      'rc-button-with-icon': withIcon,
      'rc-button-with-inline': inline
    });
    return _react.default.createElement(_Button.default, (0, _extends2.default)({
      "data-test-automation-id": testAutomationId
    }, props, {
      className: classNames
    }), children);
  };

  return Button;
}(_react.default.Component);

exports.Button = Button;
(0, _defineProperty2.default)(Button, "propTypes", {
  testAutomationId: _propTypes.default.string,
  withIcon: _propTypes.default.bool,
  iconOnly: _propTypes.default.bool,
  children: _propTypes.default.node,
  className: _propTypes.default.string,
  inline: _propTypes.default.bool
});
(0, _defineProperty2.default)(Button, "defaultProps", {
  testAutomationId: 'button',
  withIcon: false,
  iconOnly: false,
  children: null,
  className: null,
  inline: false
});