"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const ui = require("@contember/ui");
const react = require("react");
function FeedbackRenderer({ accessorTreeState, children }) {
  react.useEffect(() => {
    if (accessorTreeState.name === "error" && accessorTreeState.error.type === "unauthorized") {
      window.location.href = "/";
    }
  }, [accessorTreeState]);
  if (accessorTreeState.name === "initializing") {
    return /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.SpinnerOverlay, {}, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx",
      lineNumber: 18,
      columnNumber: 10
    }, this);
  }
  if (accessorTreeState.name === "error") {
    if (accessorTreeState.error.type === "unauthorized") {
      return null;
    }
    {
      throw accessorTreeState.error;
    }
  }
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx",
    lineNumber: 32,
    columnNumber: 9
  }, this);
}
exports.FeedbackRenderer = FeedbackRenderer;
//# sourceMappingURL=FeedbackRenderer.cjs.map
