Add a confirmation dialog

This commit is contained in:
Manuel Bustillo 2025-06-01 17:48:47 +02:00
parent f256e0f9e7
commit 72691f7070

View File

@ -54,9 +54,11 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
<TrashIcon
className="w-5 h-5 text-white absolute top-2 right-2 opacity-0 group-hover:opacity-100 cursor-pointer"
onClick={() => {
api.destroy(serializer, invitation, () => {
onDestroy(invitation);
});
if (window.confirm("Are you sure you want to delete this invitation?")) {
api.destroy(serializer, invitation, () => {
onDestroy(invitation);
});
}
}}
/>