"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CmsFieldModal = void 0;
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _ActionModal = require("../ActionModal");
var _CmsFieldForm = require("./CmsFieldForm");
var _CmsFieldModalStCss = require("./CmsFieldModal.st.css.js");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CmsFieldManagement/CmsFieldModal.tsx";
const CmsFieldModal = exports.CmsFieldModal = (0, _mobxReactLite.observer)(({
  state
}) => {
  const {
    formState
  } = state;
  return /*#__PURE__*/_react.default.createElement(_ActionModal.CustomActionModal, {
    dataHook: "cms-field-modal",
    state: state.modal,
    onAfterClose: () => state.reset(),
    title: (formState == null ? void 0 : formState.mode) === 'edit' ? 'Edit field' : 'Add a field',
    content: formState ? /*#__PURE__*/_react.default.createElement(_CmsFieldForm.CmsFieldForm, {
      state: formState,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 18,
        columnNumber: 30
      }
    }) : null,
    primaryButtonText: "Save",
    secondaryButtonText: "Cancel",
    width: 600,
    showFooterDivider: true,
    className: _CmsFieldModalStCss.classes.modal,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 13,
      columnNumber: 7
    }
  });
});
//# sourceMappingURL=CmsFieldModal.js.map