import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { IconButton } from '@atlaskit/button/new';
import { fg } from '@atlaskit/platform-feature-flags';
import Tooltip from '@atlaskit/tooltip';
import { useMouseDownEvent } from '../../../../../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 = useMouseDownEvent();
  return /*#__PURE__*/React.createElement(Tooltip, {
    content: content,
    hideTooltipOnClick: true,
    tag: "span",
    testId: "".concat(testId, "-tooltip")
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
    appearance: "subtle",
    icon: icon,
    label: label,
    onClick: onClick,
    onMouseDown: onMouseDown,
    testId: "".concat(testId, "-button"),
    role: role
  }, fg('navx-4719-a11y-embed-modal-focus-states') ? {
    ref: focusRef
  } : {})));
};
export default LinkInfoButton;