"use strict";

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

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

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

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

var _ToolbarItemContents = _interopRequireDefault(require("../ToolbarItemContents"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var ToolbarButton = function ToolbarButton(props, context) {
  return _react["default"].createElement("button", {
    className: (0, _classnames["default"])({
      toolbar__button: true,
      "is-active": props.isActive
    }),
    type: "button",
    disabled: props.isDisabled,
    "data-test-section": props.testSection,
    "data-track-id": props.testSection,
    onClick: props.onClick
  }, (0, _ToolbarItemContents["default"])(props));
};

ToolbarButton.propTypes = {
  icon: _propTypes["default"].string,
  isActive: _propTypes["default"].bool,
  isDisabled: _propTypes["default"].bool,
  isDropdown: _propTypes["default"].bool,
  label: _propTypes["default"].oneOfType([_propTypes["default"].node.isRequired, _propTypes["default"].string.isRequired]).isRequired,
  onClick: _propTypes["default"].func,
  testSection: _propTypes["default"].string,
  title: _propTypes["default"].string
};
ToolbarButton.defaultProps = {
  isDropdown: false,
  isActive: false,
  isDisabled: false
};
var _default = ToolbarButton;
exports["default"] = _default;