"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.MessageActionModal = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _designSystem = require("@wix/design-system");
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _CollectionModal = require("../CollectionModal");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/ActionModal/MessageActionModal.tsx";
function _MessageActionModal({
  state,
  content,
  onAfterClose,
  primaryButtonOnClick,
  secondaryButtonOnClick,
  onCloseButtonClick,
  ...rest
}) {
  const {
    modal
  } = state;
  return /*#__PURE__*/_react.default.createElement(_CollectionModal.ModalWrapper, {
    state: modal,
    onAfterClose: () => {
      state.afterClose();
      onAfterClose == null || onAfterClose();
    },
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 35,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.MessageModalLayout, (0, _extends2.default)({
    dataHook: "collection-action-modal"
  }, rest, {
    onCloseButtonClick: e => {
      modal.close();
      onCloseButtonClick == null || onCloseButtonClick(e);
    },
    primaryButtonOnClick: () => {
      modal.confirm();
      primaryButtonOnClick == null || primaryButtonOnClick();
    },
    secondaryButtonOnClick: rest.secondaryButtonText ? () => {
      modal.decline();
      secondaryButtonOnClick == null || secondaryButtonOnClick();
    } : undefined,
    content: typeof content === 'string' ? /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
      dataHook: "action-modal-content",
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 63,
        columnNumber: 13
      }
    }, content) : content,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 42,
      columnNumber: 7
    }
  })));
}
const MessageActionModal = exports.MessageActionModal = (0, _mobxReactLite.observer)(_MessageActionModal);
//# sourceMappingURL=MessageActionModal.js.map