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