Update component.jsx
Added the additional fields gained by switching the API endpoint.
This commit is contained in:
parent
12dff53b13
commit
5d962b4e37
@ -23,12 +23,21 @@ export default function Component({ service }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response) {
|
if (response) {
|
||||||
const platforms = response.filter((x) => x.rom_count !== 0).length;
|
const platforms = response.PLATFORMS;
|
||||||
const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0);
|
const totalRoms = response.ROMS;
|
||||||
|
const totalSaves = response.SAVES;
|
||||||
|
const totalStates = response.STATES;
|
||||||
|
const totalScreenshots = response.SCREENSHOTS;
|
||||||
|
const totalFilesizeGB = (response.FILESIZE / (1024 ** 3)).toFixed(2);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block label="romm.platforms" value={t("common.number", { value: platforms })} />
|
<Block label="romm.platforms" value={t("common.number", { value: platforms })} />
|
||||||
<Block label="romm.totalRoms" value={t("common.number", { value: totalRoms })} />
|
<Block label="romm.totalRoms" value={t("common.number", { value: totalRoms })} />
|
||||||
|
<Block label="romm.totalSaves" value={t("common.number", { value: totalSaves })} />
|
||||||
|
<Block label="romm.totalStates" value={t("common.number", { value: totalStates })} />
|
||||||
|
<Block label="romm.totalScreenshots" value={t("common.number", { value: totalScreenshots })} />
|
||||||
|
<Block label="romm.totalFilesize" value={t("common.filesize", { value: totalFilesizeGB })} />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user