"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CustomActionModal = 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/CustomActionModal.tsx";
function _CustomActionModal({
  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: 32,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.CustomModalLayout, (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, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 58,
        columnNumber: 48
      }
    }, content) : content,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 39,
      columnNumber: 7
    }
  })));
}
const CustomActionModal = exports.CustomActionModal = (0, _mobxReactLite.observer)(_CustomActionModal);
//# sourceMappingURL=CustomActionModal.js.map