mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-29 04:32:57 +00:00
Pass time and translation values into usage rendering so React Compiler invalidates cached labels when they change. Use the same localized window names and percentage meanings in sidebar summaries.
22 lines
654 B
TypeScript
22 lines
654 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { useUsagePreferences } 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 } = useUsagePreferences(serverId);
|
|
return (
|
|
<UsageSection
|
|
serverId={serverId}
|
|
title={t("providerUsage.title")}
|
|
view={view}
|
|
display={display}
|
|
onRefresh={refresh}
|
|
testID="usage-card"
|
|
/>
|
|
);
|
|
}
|