import { useQuery } from "@tanstack/react-query"; import Loader from "../../assets/loader.svg"; import { CodexSdk } from "../../sdk/codex"; import { SpaceAllocation } from "@codex/marketplace-ui-components"; export function NodeSpaceAllocation() { const { data: space, isPending } = useQuery({ queryFn: () => CodexSdk.data().then((data) => data.space()), queryKey: ["space"], refetchOnMount: true, }); if (isPending || !space) { return Loader; } if (space.error) { // TODO Sentry return ""; } const { quotaMaxBytes = 0, quotaReservedBytes = 0, quotaUsedBytes = 0, } = space.data; return ( ); }