diff --git a/src/widgets/romm/component.jsx b/src/widgets/romm/component.jsx index 4fec8867..edeb9cca 100644 --- a/src/widgets/romm/component.jsx +++ b/src/widgets/romm/component.jsx @@ -3,30 +3,30 @@ import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; export default function Component({ service }) { -const { widget } = service; + const { widget } = service; -const { data: response, error: responseError } = useWidgetAPI(widget, "statistics"); + const { data: response, error: responseError } = useWidgetAPI(widget, "statistics"); -if (responseError) { - return ( - - - - ); + if (responseError) { + return ( + + + + ); + } + + if (responseError) { + return ; + } + + if (response) { + const platforms = response.filter(x => x.rom_count !== 0).length + const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0); + return ( + + + + + ); + } } - -if (responseError) { - return ; -} - -if (response) { - const platforms = response.filter(x => x.rom_count !== 0).length - const totalRoms = response.reduce((total, stat) => total + stat.rom_count, 0); - return ( - - - - - ); -} -} \ No newline at end of file