import { _ as _slicedToArray } from './slicedToArray-be2f7a22.js';
import React, { useState } from 'react';
import Modal from 'react-bootstrap/Modal';
import './_commonjsHelpers-0c4b6f40.js';
import './web.dom.iterable-4109ff68.js';
import './es6.string.iterator-bc33758b.js';
import './_to-object-b50e61c3.js';
import './core.get-iterator-method-133dfacd.js';

var PopUpModal = function PopUpModal(props) {
  var _ref = props.ModalImage ? useState(true) : useState(false),
      _ref2 = _slicedToArray(_ref, 2),
      show = _ref2[0],
      setShow = _ref2[1];

  var launchModalButton = function launchModalButton(e) {
    window.open(props.landingURL, '_blank');
    setShow(false);
  };

  return React.createElement(
    Modal,
    { show: show, onHide: function onHide() {
        return setShow(false);
      }, 'aria-labelledby': 'Popup-Modal' },
    React.createElement(Modal.Title, null),
    React.createElement(
      Modal.Body,
      null,
      React.createElement(
        'div',
        { className: 'modalImageHolder' },
        React.createElement('img', { className: 'modalImage', src: props.ModalImage, onClick: function onClick() {
            return launchModalButton();
          } }),
        React.createElement(
          'div',
          { className: 'modalClose', onClick: function onClick() {
              return setShow(false);
            } },
          'X'
        )
      )
    ),
    React.createElement(
      'style',
      { jsx: 'true' },
      '\n          .modalImageHolder {\n            display: flex;\n            justify-content: center;\n          }\n          .modalClose {\n            display: flex;\n            justify-content: center;\n            width: 25px;\n            height: 25px;\n            font-size: 1.25rem;\n            color: #fff;\n            cursor: pointer;\n          }\n          .modalImage {\n            cursor: pointer;\n          }\n        '
    )
  );
};

export default PopUpModal;
