From 5d962b4e370da45d372d4fb8c5298b946150b80f Mon Sep 17 00:00:00 2001 From: InsertDisc <31751462+InsertDisc@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:49:25 -0400 Subject: [PATCH] Update component.jsx Added the additional fields gained by switching the API endpoint. --- src/widgets/romm/component.jsx | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/widgets/romm/component.jsx b/src/widgets/romm/component.jsx index 44b114b03..eebf7a156 100644 --- a/src/widgets/romm/component.jsx +++ b/src/widgets/romm/component.jsx @@ -23,13 +23,22 @@ export default function Component({ service }) { } if (response) { - const platforms = response.filter((x) => x.rom_count !== 0).length; - const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0); - return ( - - - - - ); - } + const platforms = response.PLATFORMS; + 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 ( + + + + + + + + + ); + } }