"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _fontAwesomeIcon = require("../../../font-awesome-icon");
var _tooltip = require("../../../tooltip");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function EditorButton({
  icon,
  testId,
  onClick,
  className = '',
  tooltipText = null
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.Tooltip, {
    content: tooltipText,
    placement: _tooltip.TOOLTIP_PLACEMENT_TYPES.TOP,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
      "test-id": testId,
      "aria-label": tooltipText ?? undefined,
      className: (0, _classnames.default)('button editor-button', className),
      onClick: onClick,
      type: "button",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
        icon: icon
      })
    })
  });
}
var _default = exports.default = EditorButton;