"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const ui = require("@contember/ui");
function QueryLoader({ query, children }) {
  if (query.state === "error") {
    return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { intent: "danger", children: "Error loading data" });
  }
  if (query.state === "loading") {
    return /* @__PURE__ */ jsxRuntime.jsx(ui.SpinnerOverlay, {});
  }
  return children({ query });
}
exports.QueryLoader = QueryLoader;
//# sourceMappingURL=QueryLoader.cjs.map
