diff --git a/components/ReportCard.tsx b/components/ReportCard.tsx
index 0076738..11320ea 100644
--- a/components/ReportCard.tsx
+++ b/components/ReportCard.tsx
@@ -6,17 +6,20 @@ import {
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 [attachmentReady, setAttachmentReady] = useState(
- !props.attachment_loading
+ const [attachmentsReady, setAttachmentReady] = useState(
+ !props.attachments_loading,
);
const actionMap: { [k: number]: number } = {};
@@ -26,8 +29,12 @@ export default function (props: ReportCardProps) {
});
async function recheckAttachment() {
- const attachmentCheck = await fetch(`/api/uploads/${props.attachment}`, {
- method: "HEAD",
+ const attachmentCheck = await fetch("/api/uploads/status", {
+ body: JSON.stringify(props.attachments),
+ headers: {
+ "content-type": "application/json",
+ },
+ method: "POST",
});
setAttachmentReady(attachmentCheck.ok);
@@ -42,14 +49,71 @@ export default function (props: ReportCardProps) {
ID(s): {props.target_ids.toString()}
- {attachmentReady ? (
-
+ {attachmentsReady ? (
+
+
+
+
+
+
+
+
) : (
- Attachment processing...
+ Attachments processing...
)}
+
+ {props.description}
- {props.attachment_loading ? (
+ {props.attachments_loading ? (