Files
paseo/packages/app/src/usage/host-usage-section.tsx
T
Mohamed Boudra e3682ba18c Usage fetches only when shown, and can be turned off (#8181)
* fix(usage): fetch only when shown and add a host-wide off switch

* fix(usage): restore policy defaults and isolate usage test state

* refactor(usage): give the sidebar footer sole ownership of its summary
2026-10-30 14:32:19 +07:00

22 lines
679 B
TypeScript

import { useTranslation } from "react-i18next";
import { useUsageDisplay } from "./display";
import { useHostUsage } from "./queries";
import { UsageSection } from "./usage-section";
/** A host's usage reports, for its settings page. */
export function HostUsageSection({ serverId }: { serverId: string }) {
const { t } = useTranslation();
const { view, refresh } = useHostUsage(serverId);
const { display } = useUsageDisplay(view.kind === "ready" ? view.reports : []);
return (
<UsageSection
serverId={serverId}
title={t("providerUsage.title")}
view={view}
display={display}
onRefresh={refresh}
testID="usage-card"
/>
);
}