import { Box, Button, Card, CardBody, CardFooter, CardHeader, Heading, HStack, Radio, RadioGroup, Spacer, Stack, Text, } from "@chakra-ui/react"; import { useState } from "react"; export default function (props: ReportCardProps) { const [attachmentIdx, setAttachmentIdx] = useState(0); const targetMap: { [k: number]: string } = {}; const [attachmentsReady, setAttachmentReady] = useState( !props.attachments_loading, ); const actionMap: { [k: number]: number } = {}; for (let i = 0; i < props.target_ids.length; i++) Object.defineProperty(targetMap, props.target_ids[i], { value: props.target_usernames[i], }); async function recheckAttachment() { const attachmentCheck = await fetch("/api/uploads/status", { body: JSON.stringify(props.attachments), headers: { "content-type": "application/json", }, method: "POST", }); setAttachmentReady(attachmentCheck.ok); } return ( Report for {props.target_usernames.toString()} ID(s): {props.target_ids.toString()} {attachmentsReady ? (
) : ( Attachments processing... )}
{props.description}
{props.attachments_loading ? ( ) : ( {(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; })()} )}
); }