import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Label } from '@/components/ui/label'; import { Input } from '@/components/ui/input'; import InputError from '@/components/ui/input-error'; import { Link, useForm, usePage } from '@inertiajs/react'; import { Button } from '@/components/ui/button'; import { Transition } from '@headlessui/react'; import type { SharedData } from '@/types'; import { FormEventHandler } from 'react'; type ProfileForm = { name: string; email: string; }; export default function UpdateUser({ mustVerifyEmail, status }: { mustVerifyEmail: boolean; status?: string }) { const { auth } = usePage().props; const { data, setData, patch, errors, processing, recentlySuccessful } = useForm>({ name: auth.user.name, email: auth.user.email, }); const submit: FormEventHandler = (e) => { e.preventDefault(); patch(route('profile.update'), { preserveScroll: true, }); }; return ( Profile information Update your profile information and email address.
setData('name', e.target.value)} required autoComplete="name" placeholder="Full name" />
setData('email', e.target.value)} required autoComplete="username" placeholder="Email address" />
{mustVerifyEmail && auth.user.email_verified_at === null && (

Your email address is unverified.{' '} Click here to resend the verification email.

{status === 'verification-link-sent' && (
A new verification link has been sent to your email address.
)}
)}

Saved

); }