From 392dd6f0d29b942078befe27c51c31efd4805d3c Mon Sep 17 00:00:00 2001 From: Felipe Cardoso Date: Wed, 19 Mar 2025 09:07:51 +0100 Subject: [PATCH] Add columns for dietary restrictions and notes to guest list Enhanced the guest list table by adding new columns for dietary restrictions and notes. These columns display content using interactive popovers when data is available, improving data accessibility and user experience. Updated existing table structure to accommodate these enhancements. --- .../src/components/guests/guests-list.tsx | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/guests/guests-list.tsx b/frontend/src/components/guests/guests-list.tsx index eb551af..1492a78 100644 --- a/frontend/src/components/guests/guests-list.tsx +++ b/frontend/src/components/guests/guests-list.tsx @@ -39,7 +39,6 @@ import { import { useGuests } from "@/context/guest-context"; import { EventResponse, - EventThemeResponse, GuestCreate, GuestRead, GuestStatus, @@ -66,6 +65,12 @@ import { } from "@/components/ui/alert-dialog"; import { useAuth } from "@/context/auth-context"; import { generateInviteLink } from "@/lib/utils"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { StickyNote, Utensils } from "lucide-react"; // Helper to generate a random invitation code const generateInvitationCode = (fullName: string): string => { @@ -522,10 +527,13 @@ const GuestListTable = ({ event }: GuestListTableProps) => { Phone Invitation Code Status - Additional Guests + Add. Guests + Diet Restr. + Notes Actions + {isLoadingGuests ? ( @@ -567,6 +575,54 @@ const GuestListTable = ({ event }: GuestListTableProps) => { {getStatusBadge(guest.status)} {guest.actual_additional_guests || 0} + + {/* Dietary Restrictions Column */} + + {guest.dietary_restrictions && + guest.dietary_restrictions.length > 0 ? ( + + + + + +

+ {guest.dietary_restrictions} +

+
+
+ ) : ( + "-" + )} +
+ + {/* Notes Column */} + + {guest.notes && guest.notes.length > 0 ? ( + + + + + +

{guest.notes}

+
+
+ ) : ( + "-" + )} +
+