import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
import { SpinnerOverlay } from "@contember/ui";
import { useEffect } from "react";
function FeedbackRenderer({ accessorTreeState, children }) {
  useEffect(() => {
    if (accessorTreeState.name === "error" && accessorTreeState.error.type === "unauthorized") {
      window.location.href = "/";
    }
  }, [accessorTreeState]);
  if (accessorTreeState.name === "initializing") {
    return /* @__PURE__ */ jsxDEV(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__ */ jsxDEV(Fragment, { children }, void 0, false, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/renderers/FeedbackRenderer.tsx",
    lineNumber: 32,
    columnNumber: 9
  }, this);
}
export {
  FeedbackRenderer
};
//# sourceMappingURL=FeedbackRenderer.js.map
