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,18 +64,20 @@ export default function (props: {
</Button> </Button>
) : ( ) : (
<Stack direction="column"> <Stack direction="column">
{Object.entries(targetMap).map(([id, username]) => { {(function () {
return ( const radioGroups = [];
for (let i = 0; i < props.target_ids.length; i++) {
radioGroups.push(
<RadioGroup <RadioGroup
name={id} name={props.target_ids[i].toString()}
onChange={(val) => onChange={(val) => {
Object.defineProperty(actionMap, parseInt(id), { Object.defineProperty(actionMap, props.target_ids[i], {
value: parseInt(val), value: parseInt(val),
}) });
} }}
> >
<Stack direction="row"> <Stack direction="row">
<Text>{username}</Text> <Text>{props.target_usernames[i]}</Text>
<Radio key={0} value="0"> <Radio key={0} value="0">
Ignore Ignore
</Radio> </Radio>
@ -88,7 +90,10 @@ export default function (props: {
</Stack> </Stack>
</RadioGroup> </RadioGroup>
); );
})} }
return radioGroups;
})()}
<Box pt="16px"> <Box pt="16px">
<Button colorScheme="blue">Submit</Button> <Button colorScheme="blue">Submit</Button>
</Box> </Box>