Fix buttons and invert attachment loading check

This commit is contained in:
regalijan 2023-10-19 16:49:24 -04:00
parent 35702eb26d
commit 952cad9bc0
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

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