import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import AKLink from '@atlaskit/link';
import { withLinkClickedEvent } from '../../../utils/analytics/click';
const Anchor = withLinkClickedEvent('a');
export const LinkComponent = withLinkClickedEvent(AKLink);
const Hyperlink = ({
  href,
  children,
  testId,
  isLinkComponent = false,
  ...props
}) => {
  const Link = isLinkComponent ? LinkComponent : Anchor;
  return /*#__PURE__*/React.createElement(Link, _extends({}, isLinkComponent ? {
    testId
  } : {
    'data-testid': testId
  }, {
    href: href || ''
  }, props), children);
};
export default Hyperlink;