From 0f5140cfe71f3392c885bfbc9e5d8a32e1a536e8 Mon Sep 17 00:00:00 2001 From: Regalijan Date: Fri, 23 Aug 2024 02:46:59 -0400 Subject: [PATCH] Display all pending reviews on inactivity notice card --- components/InactivityNoticeCard.tsx | 47 ++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/components/InactivityNoticeCard.tsx b/components/InactivityNoticeCard.tsx index 5d2c04b..91ca9c2 100644 --- a/components/InactivityNoticeCard.tsx +++ b/components/InactivityNoticeCard.tsx @@ -51,7 +51,6 @@ export default function ( }); setLoading(false); - props.port?.postMessage(`inactivity_${props.id}`); } const Approved = () => ( @@ -66,6 +65,18 @@ export default function ( ); + const Pending = () => ( + + + + ); + return ( @@ -94,23 +105,31 @@ export default function ( ) : null} - {Object.keys(props.decisions as { [k: string]: boolean }).length ? ( - - Decisions - - {Object.entries( - props.decisions as { [k: string]: boolean }, - ).map(([dept, accepted]) => ( + + Decisions + + {props.departments.map((d) => { + const dept = d as "ET" | "DM" | "FM" | "WM"; + + return ( - {dept}:  - {accepted ? : } + {d}:  + {typeof props.decisions[dept] === "boolean" ? ( + props.decisions[dept] ? ( + + ) : ( + + ) + ) : ( + + )} - ))} - - - ) : null} + ); + })} + +