Skip to content

Commit

Permalink
Fix: format Romm statistics (#3358)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardSalter committed Apr 23, 2024
1 parent 3404243 commit daa51f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/widgets/romm/component.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { useTranslation } from "next-i18next";

import Container from "components/services/widget/container";
import Block from "components/services/widget/block";
import useWidgetAPI from "utils/proxy/use-widget-api";

export default function Component({ service }) {
const { widget } = service;
const { t } = useTranslation();

const { data: response, error: responseError } = useWidgetAPI(widget, "statistics");

Expand All @@ -24,8 +27,8 @@ export default function Component({ service }) {
const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0);
return (
<Container service={service}>
<Block label="romm.platforms" value={platforms} />
<Block label="romm.totalRoms" value={totalRoms} />
<Block label="romm.platforms" value={t("common.number", { value: platforms })} />
<Block label="romm.totalRoms" value={t("common.number", { value: totalRoms })} />
</Container>
);
}
Expand Down

0 comments on commit daa51f9

Please sign in to comment.