"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.EntityPageWrapper = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _EntityPagePlain = require("./EntityPagePlain");
var _PageErrorState = require("../PageErrorState");
var _react2 = require("@wix/bex-core/react");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/EntityPage/EntityPageWrapper.tsx";
function _EntityPageWrapper({
  state,
  ...rest
}) {
  const {
    translate: t
  } = (0, _react2.useWixPatternsContainer)();
  if (state.initTask.status.isError) {
    return /*#__PURE__*/_react.default.createElement(_PageErrorState.PageErrorState, (0, _extends2.default)({
      title: t('cairo.page.loadError.failedState.title'),
      subtitle: t('cairo.page.loadError.failedState.description'),
      retryText: t('cairo.page.loadError.failedState.CTA'),
      onRetry: () => state.retryFetch()
    }, rest, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 20,
        columnNumber: 7
      }
    }));
  }
  return /*#__PURE__*/_react.default.createElement(_EntityPagePlain.EntityPagePlain, (0, _extends2.default)({
    state: state
  }, rest, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 10
    }
  }));
}
const EntityPageWrapper = exports.EntityPageWrapper = (0, _mobxReactLite.observer)(_EntityPageWrapper);
//# sourceMappingURL=EntityPageWrapper.js.map