Generate invitations PDF asynchronously #311

Merged
bustikiller merged 2 commits from generate-invitations-doc-async into main 2025-07-08 17:49:17 +00:00
Showing only changes of commit fba75025d4 - Show all commits

View File

@ -11,6 +11,7 @@ import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline";
import { useEffect, useRef } from "react";
import { useState } from "react";
import { classNames } from "../components/button";
import { Toast } from "primereact/toast";
function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
invitation: Invitation,
@ -117,6 +118,7 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
guests: Array<Guest>,
invitations: Array<Invitation>
}) {
const toast = useRef<Toast>(null);
const api = new AbstractApi<Invitation>();
const serializer = new InvitationSerializer();
@ -147,13 +149,18 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
function handleDownloadQrCodes() {
api.post(serializer, 'email', () => {
console.log("Email scheduled to be sent with QR codes.");
toast.current?.show({
severity: 'success',
summary: 'Email scheduled',
detail: 'A document with the QR codes will be sent to the organizer\'s email.'
});
})
}
return (
<div className="flex h-screen">
{/* Left Column: Guests */}
<Toast ref={toast} />
<div className="w-1/4 h-full overflow-auto border-r border-gray-300 p-4">
<h2 className="text-lg font-semibold mb-4">{unassignedGuests.length} guests without invitation</h2>
<div>