"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 }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ToolbarLink = function ToolbarLink(props, context) {
  var _classNames;

  return _react["default"].createElement("a", {
    className: (0, _classnames["default"])((_classNames = {
      flex: true,
      toolbar__button: true,
      "is-active": props.isActive
    }, _defineProperty(_classNames, "link--disabled", props.isDisabled), _defineProperty(_classNames, "pointer-events--none", props.isDisabled), _classNames)),
    "data-test-section": props.testSection,
    href: props.href
  }, (0, _ToolbarItemContents["default"])(props));
};

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