"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _new = require("@atlaskit/button/new");
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
var _useLinkClicked = require("../../../../../state/analytics/useLinkClicked");
var LinkInfoButton = function LinkInfoButton(_ref) {
  var content = _ref.content,
    icon = _ref.icon,
    label = _ref.label,
    onClick = _ref.onClick,
    testId = _ref.testId,
    role = _ref.role,
    focusRef = _ref.focusRef;
  var onMouseDown = (0, _useLinkClicked.useMouseDownEvent)();
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
    content: content,
    hideTooltipOnClick: true,
    tag: "span",
    testId: "".concat(testId, "-tooltip")
  }, /*#__PURE__*/_react.default.createElement(_new.IconButton, (0, _extends2.default)({
    appearance: "subtle",
    icon: icon,
    label: label,
    onClick: onClick,
    onMouseDown: onMouseDown,
    testId: "".concat(testId, "-button"),
    role: role
  }, (0, _platformFeatureFlags.fg)('navx-4719-a11y-embed-modal-focus-states') ? {
    ref: focusRef
  } : {})));
};
var _default = exports.default = LinkInfoButton;