Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix buttons and invert attachment loading check
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 35702eb commit 952cad9
Showing 1 changed file with 33 additions and 28 deletions.
61 changes: 33 additions & 28 deletions components/ReportCard.tsx
Expand Up @@ -40,7 +40,7 @@ export default function (props: {
}

return (
<Card>
<Card w="100%">
<CardHeader>
<Heading size="lg">
Report for {props.target_usernames.toString()}
Expand All @@ -49,9 +49,9 @@ export default function (props: {
</CardHeader>
<CardBody>
{attachmentReady ? (
<Text>Attachment processing...</Text>
) : (
<video src={`/api/uploads/${props.attachment}`} width="100%" />
) : (
<Text>Attachment processing...</Text>
)}
</CardBody>
<CardFooter>
Expand All @@ -64,31 +64,36 @@ export default function (props: {
</Button>
) : (
<Stack direction="column">
{Object.entries(targetMap).map(([id, username]) => {
return (
<RadioGroup
name={id}
onChange={(val) =>
Object.defineProperty(actionMap, parseInt(id), {
value: parseInt(val),
})
}
>
<Stack direction="row">
<Text>{username}</Text>
<Radio key={0} value="0">
Ignore
</Radio>
<Radio key={1} value="1">
Hide from Leaderboards
</Radio>
<Radio key={2} value="2">
Ban
</Radio>
</Stack>
</RadioGroup>
);
})}
{(function () {
const radioGroups = [];
for (let i = 0; i < props.target_ids.length; i++) {
radioGroups.push(
<RadioGroup
name={props.target_ids[i].toString()}
onChange={(val) => {
Object.defineProperty(actionMap, props.target_ids[i], {
value: parseInt(val),
});
}}
>
<Stack direction="row">
<Text>{props.target_usernames[i]}</Text>
<Radio key={0} value="0">
Ignore
</Radio>
<Radio key={1} value="1">
Hide from Leaderboards
</Radio>
<Radio key={2} value="2">
Ban
</Radio>
</Stack>
</RadioGroup>
);
}

return radioGroups;
})()}
<Box pt="16px">
<Button colorScheme="blue">Submit</Button>
</Box>
Expand Down

0 comments on commit 952cad9

Please sign in to comment.