"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CustomFieldsWidgetCommonComponents = void 0;
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _react2 = require("@wix/bex-core/react");
var _DeleteFieldModal = require("../ArchivedItemsPanel/DeleteFieldModal");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CustomFieldsWidget/CustomFieldsWidgetCommonComponents.tsx";
const _CustomFieldsWidgetCommonComponents = ({
  state
}) => {
  const page = (0, _react2.usePageContext)();
  const {
    modalsContainerRef,
    stackingRootRef
  } = page;
  if (state.isLoading) {
    return null;
  }
  const WixPatternsModalsContainer = state.WixPatternsModalsContainer;
  const CustomFieldModal = state.CustomFieldModal;
  const ArchiveFieldModal = state.ArchiveFieldModal;
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, WixPatternsModalsContainer && /*#__PURE__*/_react.default.createElement(WixPatternsModalsContainer, {
    rootRef: stackingRootRef,
    anchorRef: modalsContainerRef,
    state: state.panels,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 9
    }
  }), CustomFieldModal && /*#__PURE__*/_react.default.createElement(CustomFieldModal, {
    state: state.customFieldsPanel.customFieldModal,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 35,
      columnNumber: 9
    }
  }), ArchiveFieldModal && /*#__PURE__*/_react.default.createElement(ArchiveFieldModal, {
    state: state.customFieldsPanel.archiveFieldModal,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 9
    }
  }), state.dataExtension.deleteFieldModal && /*#__PURE__*/_react.default.createElement(_DeleteFieldModal.DeleteFieldModal, {
    state: state.dataExtension.deleteFieldModal,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 41,
      columnNumber: 9
    }
  }));
};
const CustomFieldsWidgetCommonComponents = exports.CustomFieldsWidgetCommonComponents = (0, _mobxReactLite.observer)(_CustomFieldsWidgetCommonComponents);
//# sourceMappingURL=CustomFieldsWidgetCommonComponents.js.map