import { jsx } from "react/jsx-runtime";
import { Box, SpinnerOverlay } from "@contember/ui";
function QueryLoader({ query, children }) {
  if (query.state === "error") {
    return /* @__PURE__ */ jsx(Box, { intent: "danger", children: "Error loading data" });
  }
  if (query.state === "loading") {
    return /* @__PURE__ */ jsx(SpinnerOverlay, {});
  }
  return children({ query });
}
export {
  QueryLoader
};
//# sourceMappingURL=QueryLoader.js.map
