import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { useIntl } from 'react-intl-next';
import { IconButton } from '@atlaskit/button/new';
import { fg } from '@atlaskit/platform-feature-flags';
import Tooltip from '@atlaskit/tooltip';
import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
const LinkInfoButton = ({
  content,
  icon,
  label,
  onClick,
  testId,
  role
}) => {
  const onMouseDown = useMouseDownEvent();
  const {
    formatMessage
  } = useIntl();
  return /*#__PURE__*/React.createElement(Tooltip, {
    content: content,
    hideTooltipOnClick: true,
    tag: "span",
    testId: `${testId}-tooltip`
  }, /*#__PURE__*/React.createElement(IconButton, _extends({
    appearance: "subtle",
    icon: icon,
    label: formatMessage(label),
    onClick: onClick,
    onMouseDown: onMouseDown,
    testId: `${testId}-button`
  }, fg('navx-2185-smart-link-preview-modal-icon-role') ? {
    role
  } : {})));
};
export default LinkInfoButton;