import { Button, Container, FormControl, FormControlLabel, FormLabel, Grid, Radio, RadioGroup, TextField, } from '@mui/material'; import { useForm, Controller } from 'react-hook-form'; import { useOutletContext } from 'react-router-dom'; import { useUpdateGuestMutation, Guest } from '../apiSlice'; function RsvpForm() { const [updateGuest] = useUpdateGuestMutation(); const guest: Guest = useOutletContext(); const { register, handleSubmit, control, formState: { errors }, } = useForm({ defaultValues: { id: guest?.id, firstName: guest?.firstName, lastName: guest?.lastName, attendance: '', email: '', partySize: 1, message: '', }, }); const onSubmit = async (data: Guest) => { updateGuest({ ...data }); }; return (

Please RSVP for the wedding by March 10, 2025. The ceremony will commence at 3 pm on April 26 in Divine Shepherd. The reception will follow at 5 pm in A Venue on the Ridge.

Will you attend? ( } label="Yes" /> } label="No" /> )} />
); } export default RsvpForm;