"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactIntl = require("react-intl");
var _new = require("@atlaskit/button/new");
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;
  var onMouseDown = (0, _useLinkClicked.useMouseDownEvent)();
  var _useIntl = (0, _reactIntl.useIntl)(),
    formatMessage = _useIntl.formatMessage;
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
    content: content,
    hideTooltipOnClick: true,
    tag: "span",
    testId: "".concat(testId, "-tooltip")
  }, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
    appearance: "subtle",
    icon: icon,
    label: formatMessage(label),
    onClick: onClick,
    onMouseDown: onMouseDown,
    testId: "".concat(testId, "-button"),
    role: role
  }));
};
var _default = exports.default = LinkInfoButton;