"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _propTypes = _interopRequireDefault(require("prop-types"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Choice = ({
  title,
  subtitle,
  onClick,
  children
}) => {
  return /*#__PURE__*/_react.default.createElement("a", {
    className: _style.default.choice,
    onClick: onClick
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.choiceContent
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.choiceLeftIconWrapper
  }, children), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.choiceDescription
  }, /*#__PURE__*/_react.default.createElement("h3", {
    className: _style.default.choiceDescriptionTitle
  }, title), /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.choiceDescriptionSubtitle
  }, subtitle))), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.choiceRightIconWrapper
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusCheckCircle2, {
    className: _style.default.choiceRightIcon
  })));
};
Choice.propTypes = process.env.NODE_ENV !== "production" ? {
  title: _propTypes.default.string,
  subtitle: _propTypes.default.string,
  onClick: _propTypes.default.func,
  children: _propTypes.default.node
} : {};
const Modal = props => {
  const {
    header,
    description,
    choices,
    onClose
  } = props;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.modalWrapper
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.modal
  }, /*#__PURE__*/_react.default.createElement("header", {
    className: _style.default.header
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.headerRightContent
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.headerRightIconWrapper
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidRemoveAddAddCircle2, {
    className: _style.default.headerAddIcon
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.shadow
  })), /*#__PURE__*/_react.default.createElement("h3", null, header)), /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidStatusClose, {
    onClick: onClose,
    className: _style.default.headerCloseIcon
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.description
    // eslint-disable-next-line react/no-danger
    ,
    dangerouslySetInnerHTML: {
      __html: description
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.choices
  }, /*#__PURE__*/_react.default.createElement(Choice, {
    key: choices.left.title,
    title: choices.left.title,
    subtitle: choices.left.subtitle
    // eslint-disable-next-line react/jsx-handler-names
    ,
    onClick: choices.left.onClick
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaLineContentEditionQuillCircle, {
    className: _style.default.choiceLeftIcon
  })), /*#__PURE__*/_react.default.createElement(Choice, {
    key: choices.right.title,
    title: choices.right.title,
    subtitle: choices.right.subtitle
    // eslint-disable-next-line react/jsx-handler-names
    ,
    onClick: choices.right.onClick
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyImportIcon, {
    className: _style.default.choiceLeftIcon
  })))));
};
Modal.propTypes = process.env.NODE_ENV !== "production" ? {
  header: _propTypes.default.string,
  description: _propTypes.default.string,
  choices: _propTypes.default.shape({
    left: _propTypes.default.shape({
      title: Choice.propTypes.title,
      subtitle: Choice.propTypes.subtitle,
      onClick: Choice.propTypes.onClick
    }),
    right: _propTypes.default.shape({
      title: Choice.propTypes.title,
      subtitle: Choice.propTypes.subtitle,
      onClick: Choice.propTypes.onClick
    })
  }),
  onClose: _propTypes.default.func
} : {};
Modal.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
var _default = exports.default = Modal;
//# sourceMappingURL=index.js.map