From 952cad9bc0c4669b893c2f4868ddf317107f0ca5 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:49:24 -0400 Subject: [PATCH] Fix buttons and invert attachment loading check --- components/ReportCard.tsx | 61 +++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/components/ReportCard.tsx b/components/ReportCard.tsx index 24714cc..ff31144 100644 --- a/components/ReportCard.tsx +++ b/components/ReportCard.tsx @@ -40,7 +40,7 @@ export default function (props: { } return ( - + Report for {props.target_usernames.toString()} @@ -49,9 +49,9 @@ export default function (props: { {attachmentReady ? ( - Attachment processing... - ) : ( @@ -64,31 +64,36 @@ export default function (props: { ) : ( - {Object.entries(targetMap).map(([id, username]) => { - return ( - - Object.defineProperty(actionMap, parseInt(id), { - value: parseInt(val), - }) - } - > - - {username} - - Ignore - - - Hide from Leaderboards - - - Ban - - - - ); - })} + {(function () { + const radioGroups = []; + for (let i = 0; i < props.target_ids.length; i++) { + radioGroups.push( + { + Object.defineProperty(actionMap, props.target_ids[i], { + value: parseInt(val), + }); + }} + > + + {props.target_usernames[i]} + + Ignore + + + Hide from Leaderboards + + + Ban + + + + ); + } + + return radioGroups; + })()}