diff --git a/app/ui/invitations/board.tsx b/app/ui/invitations/board.tsx index 9bb95e9..d34cbb8 100644 --- a/app/ui/invitations/board.tsx +++ b/app/ui/invitations/board.tsx @@ -18,6 +18,13 @@ export default function InvitationsBoard({ guests, invitations }: { ) ); + // Sort invitations to display those without guests at the top + const sortedInvitations = [...invitations].sort((a, b) => { + if (a.guests.length === 0 && b.guests.length > 0) return -1; + if (a.guests.length > 0 && b.guests.length === 0) return 1; + return 0; + }); + function handleCreateInvitation() { api.create(serializer, new Invitation(), () => { console.log("Invitation created successfully"); @@ -28,48 +35,54 @@ export default function InvitationsBoard({ guests, invitations }: {
+ (empty invitation) +
+ ) : ( +