diff --git a/frontend/src/components/EventAdmin.tsx b/frontend/src/components/EventAdmin.tsx index 5f4b2ac..3c05bdd 100644 --- a/frontend/src/components/EventAdmin.tsx +++ b/frontend/src/components/EventAdmin.tsx @@ -601,7 +601,13 @@ const EventAdmin: React.FC = () => { - RSVPs ({rsvps.length}) + RSVPs ({rsvps.length}) | Total Guests: {rsvps.reduce((total, rsvp) => { + // Count the RSVP person as 1 if they're attending + const rsvpCount = rsvp.attending === 'yes' ? 1 : 0; + // Add their guests if they're bringing any + const guestCount = (rsvp.attending === 'yes' && rsvp.bringing_guests === 'yes') ? rsvp.guest_count : 0; + return total + rsvpCount + guestCount; + }, 0)} { - RSVPs ({rsvps.length}) + RSVPs ({rsvps.length}) | Total Guests: {rsvps.reduce((total, rsvp) => { + // Count the RSVP person as 1 if they're attending + const rsvpCount = rsvp.attending === 'yes' ? 1 : 0; + // Add their guests if they're bringing any + const guestCount = (rsvp.attending === 'yes' && rsvp.bringing_guests === 'yes') ? rsvp.guest_count : 0; + return total + rsvpCount + guestCount; + }, 0)}