/* index.tsx generated by @compiled/babel-plugin v0.39.1 */
import _extends from "@babel/runtime/helpers/extends";
import "./index.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { FormattedMessage, injectIntl, IntlProvider } from 'react-intl';
import Button from '@atlaskit/button/standard-button';
import Link from '@atlaskit/link';
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
import { messages } from '../../../messages';
var breakWordsCss = null;
var WarningModal = function WarningModal(props) {
  var isOpen = props.isOpen,
    unsafeLinkText = props.unsafeLinkText,
    url = props.url,
    onClose = props.onClose,
    onContinue = props.onContinue,
    intl = props.intl;
  var content = /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(Modal, {
    onClose: onClose,
    testId: "link-with-safety-warning"
  }, /*#__PURE__*/React.createElement(ModalHeader, {
    hasCloseButton: true
  }, /*#__PURE__*/React.createElement(ModalTitle, {
    appearance: "warning"
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.check_this_link))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("div", {
    className: ax(["_o5726vc6 _1nmz9jpi"])
  }, url && unsafeLinkText && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.link_safety_warning_message, {
    values: {
      unsafeLinkText: unsafeLinkText,
      a: function a() {
        return /*#__PURE__*/React.createElement(Link, {
          href: url,
          target: "_blank",
          rel: "noopener noreferrer"
        }, url);
      }
    }
  })))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
    appearance: "subtle",
    onClick: onClose
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.go_back)), /*#__PURE__*/React.createElement(Button, {
    appearance: "warning",
    onClick: onContinue,
    autoFocus: true
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.continue)))));
  return intl ? content : /*#__PURE__*/React.createElement(IntlProvider, {
    locale: "en"
  }, content);
};
var _default_1 = injectIntl(WarningModal, {
  enforceContext: false
});
export default _default_1;