import { Form, Head } from '@inertiajs/react'; import { useState } from 'react'; import { toast } from 'sonner'; import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController'; import { DatePicker } from '@/components/inputs'; import { InputError } from '@/components/ui'; import { PhoneNumberInput } from '@/components/inputs'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; import { Textarea } from '@/components/ui/textarea'; import { edit } from '@/routes/profile'; type UserData = { id: number; email: string; username: string; userProfile: { full_name: string; phone_number: string | null; gender: string | null; birth_date: string | null; address: string | null; } | null; }; type Props = { user: UserData; mustVerifyEmail: boolean; status?: string; }; export default function Profile({ user }: Props) { const [birthDate, setBirthDate] = useState( user.userProfile?.birth_date ? new Date(user.userProfile.birth_date) : undefined, ); return ( <>
{ toast.error('Ada data yang belum sesuai, silakan periksa kembali input Anda.'); }} > {({ processing, errors }) => (
Akun
Profil