import { Form, Head } from '@inertiajs/react'; import { useState } from 'react'; import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController'; import { DatePicker } from '@/components/date-picker'; import InputError from '@/components/input-error'; import { PhoneNumberInput } from '@/components/phone-number-input'; 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 ( <>
{({ processing, errors }) => (
Akun
Profil