mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 22:28:48 +00:00
Fix: format Romm statistics (#3358)
This commit is contained in:
parent
340424391f
commit
daa51f9740
1 changed files with 5 additions and 2 deletions
|
@ -1,9 +1,12 @@
|
||||||
|
import { useTranslation } from "next-i18next";
|
||||||
|
|
||||||
import Container from "components/services/widget/container";
|
import Container from "components/services/widget/container";
|
||||||
import Block from "components/services/widget/block";
|
import Block from "components/services/widget/block";
|
||||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||||
|
|
||||||
export default function Component({ service }) {
|
export default function Component({ service }) {
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { data: response, error: responseError } = useWidgetAPI(widget, "statistics");
|
const { data: response, error: responseError } = useWidgetAPI(widget, "statistics");
|
||||||
|
|
||||||
|
@ -24,8 +27,8 @@ export default function Component({ service }) {
|
||||||
const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0);
|
const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0);
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block label="romm.platforms" value={platforms} />
|
<Block label="romm.platforms" value={t("common.number", { value: platforms })} />
|
||||||
<Block label="romm.totalRoms" value={totalRoms} />
|
<Block label="romm.totalRoms" value={t("common.number", { value: totalRoms })} />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue