From ac6bf24d5783b530ca11ef858a3eedd9cc64e2e9 Mon Sep 17 00:00:00 2001 From: z1glr Date: Sat, 11 Jan 2025 19:10:02 +0000 Subject: [PATCH] improved assignments table formatting --- client/src/app/assignments/page.tsx | 112 ++++++++++++++++++++-------- 1 file changed, 79 insertions(+), 33 deletions(-) diff --git a/client/src/app/assignments/page.tsx b/client/src/app/assignments/page.tsx index 944bc01..5a89e5a 100644 --- a/client/src/app/assignments/page.tsx +++ b/client/src/app/assignments/page.tsx @@ -2,19 +2,29 @@ import AddEvent from "@/components/Event/AddEvent"; import LocalDate from "@/components/LocalDate"; -import { apiCall } from "@/lib"; -import { Availability, EventData, getTasks, Task } from "@/Zustand"; -import { Add, Copy, Edit, TrashCan } from "@carbon/icons-react"; +import { apiCall, getTasks } from "@/lib"; +import { EventData } from "@/Zustand"; +import { + Add, + AddLarge, + Copy, + Edit, + NotAvailable, + TrashCan, +} from "@carbon/icons-react"; import { Button, ButtonGroup, + Chip, + Dropdown, + DropdownItem, + DropdownMenu, + DropdownTrigger, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, - Select, - SelectItem, Table, TableBody, TableCell, @@ -131,7 +141,7 @@ export default function AdminPanel() { ); case "description": - return {event[key]}; + return {event[key]}; case "actions": return (
@@ -164,33 +174,65 @@ export default function AdminPanel() { // only show the selector, if the task is needed for the event if (Object.keys(event.tasks).includes(key as string)) { return ( - + + + {!!event.tasks[key as string] ? ( + alert("implement")}> + {event.tasks[key as string]} + + ) : ( + + )} + + + {Object.entries(event.availabilities).map( + ([volunteer, availability]) => ( + + {volunteer} ({availability}) + + ), + )} + + + // ); + } else { + return ; } } } @@ -253,7 +295,11 @@ export default function AdminPanel() { - + events.reload()} + /> {activeEvent !== undefined ? (