import { jsx } from "react/jsx-runtime";
import { Box, ContainerSpinner } 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(ContainerSpinner, {});
  }
  return children({ query });
}
export {
  QueryLoader
};
//# sourceMappingURL=QueryLoader.js.map
