From 0a3bbf28eec61f61f2faac359031d7036c7d2715 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:53 -0400 Subject: [PATCH] ACTUALLY fix it now --- components/InactivityNoticeCard.tsx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/components/InactivityNoticeCard.tsx b/components/InactivityNoticeCard.tsx index 36b4b56..b108a70 100644 --- a/components/InactivityNoticeCard.tsx +++ b/components/InactivityNoticeCard.tsx @@ -11,19 +11,19 @@ import { StackDivider, Text, UnorderedList, - useToast, + useToast } from "@chakra-ui/react"; -export default function (props: InactivityNoticeProps) { +export default function(props: InactivityNoticeProps) { const toast = useToast(); async function makeDecision(accepted: boolean) { const decisionReq = await fetch(`/api/inactivity/${props.id}`, { body: JSON.stringify({ accepted }), headers: { - "content-type": "application/json", + "content-type": "application/json" }, - method: "POST", + method: "POST" }); if (!decisionReq.ok) { @@ -31,7 +31,7 @@ export default function (props: InactivityNoticeProps) { description: ((await decisionReq.json()) as { error: string }).error, isClosable: true, status: "error", - title: "Oops", + title: "Oops" }); return; @@ -41,7 +41,7 @@ export default function (props: InactivityNoticeProps) { description: `Inactivity notice ${accepted ? "accepted" : "denied"}.`, isClosable: true, status: "success", - title: "Success", + title: "Success" }); location.reload(); @@ -49,13 +49,15 @@ export default function (props: InactivityNoticeProps) { const Approved = () => ( - + ); const Denied = () => ( - + ); @@ -85,8 +87,9 @@ export default function (props: InactivityNoticeProps) { {Object.entries(props.decisions).map(([dept, accepted]) => ( - - {accepted ? : } {dept} + + {dept}:  + {accepted ? : } ))}