import { Box, ContainerSpinner } from "@contember/ui";
import { jsxDEV } from "react/jsx-dev-runtime";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/tenant/components/QueryLoader.tsx";
function QueryLoader({
  query,
  children
}) {
  if (query.state === "error") {
    return /* @__PURE__ */ jsxDEV(Box, {
      intent: "danger",
      children: "Error loading data"
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 7,
      columnNumber: 10
    }, this);
  }
  if (query.state === "loading") {
    return /* @__PURE__ */ jsxDEV(ContainerSpinner, {}, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 10,
      columnNumber: 10
    }, this);
  }
  return children({
    query
  });
}
export {
  QueryLoader
};
//# sourceMappingURL=QueryLoader.js.map
