From e946e47a84141f863bd689172416e9f9617fbe3d Mon Sep 17 00:00:00 2001 From: jyswee Date: Thu, 23 Jul 2026 22:13:02 +0000 Subject: [PATCH] Seed: wedding template (15 files) --- src/pages/Rsvp.tsx | 141 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 src/pages/Rsvp.tsx diff --git a/src/pages/Rsvp.tsx b/src/pages/Rsvp.tsx new file mode 100644 index 0000000..2e6008c --- /dev/null +++ b/src/pages/Rsvp.tsx @@ -0,0 +1,141 @@ +import { useState } from "react"; +import { toast } from "sonner"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Textarea } from "@/components/ui/textarea"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Heart, Send, Calendar } from "lucide-react"; +import { useSaasMutation } from "@/hooks/use-tygarun"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; + +export default function RsvpPage() { + const [attending, setAttending] = useState("yes"); + const [guests, setGuests] = useState("1"); + const [dietary, setDietary] = useState(""); + const { mutate: createLead, loading: sending } = useSaasMutation("crm", "/leads"); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + const form = e.currentTarget; + const data = new FormData(form); + try { + await createLead({ + name: data.get("name"), + email: data.get("email"), + attending, + guests, + dietary, + song: data.get("song"), + message: data.get("message"), + }); + toast.success("Thank you! Your RSVP has been received.", { description: "We cannot wait to celebrate with you!" }); + form.reset(); + setAttending("yes"); + setGuests("1"); + setDietary(""); + } catch (err) { + toast.error("Could not send your RSVP. Please try again."); + } + }; + + return ( +
+
+ +
+
+

We Would Love to Have You

+

RSVP

+

Please let us know if you can make it. We would be honored to have you celebrate with us.

+ + + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+ + +
+
+
+ + {attending === "yes" && ( + <> +
+ + +
+ +
+ + +
+ +
+ + +
+ + )} + +
+ +