import Link from "next/link" import { RsvpForm } from "@/components/invite/rsvp-form" import { WeddingContainer } from "@/components/invite/wedding-container" import type { InvitationDetail } from "@/lib/db/queries/invitations" import type { ToastRequest } from "@/lib/db/types" import type { GuestDictionary } from "@/lib/i18n/dictionaries" import type { InvitePageContent } from "@/lib/i18n/invite-page/content" export function RsvpSection(props: { action: (formData: FormData) => void | Promise detail: InvitationDetail token: string dictionary: GuestDictionary content: InvitePageContent["rsvp"] closed: boolean toastRequest: ToastRequest | undefined photo: { filename: string | null; url: string } | null submitted?: string error?: string }) { const message = props.closed ? props.dictionary.deadline.closed : props.submitted ? props.dictionary.form.submitted : props.error === "closed" ? props.dictionary.errors.closed : props.error ? props.dictionary.errors.generic : null const isSingularPerson = props.detail.members.length === 1; return (

{props.content.eyebrow}

{props.detail.invitation.display_name}

{isSingularPerson ? props.content.heading_singular : props.content.heading_plural}

{props.content.paragraph} {props.content.deadline}.

{isSingularPerson ? props.content.helper_singular : props.content.helper_plural}

{props.content.faqLink} →
{message ?

{message}

: null}
) }