import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController'; import { Button } from '@/components/ui/button'; import { Calendar } from "@/components/ui/calendar"; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Field, FieldError } from "@/components/ui/field"; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; import { Textarea } from '@/components/ui/textarea'; import { edit } from '@/routes/profile'; import { Head, useForm, usePage } from '@inertiajs/react'; import { Loader, Save } from 'lucide-react'; import React from 'react'; import { toast } from 'sonner'; export default function Profile({ status, }: { status?: string; }) { const { auth } = usePage().props; const [isCalendarOpen, setIsCalendarOpen] = React.useState(false); const { data, setData, patch, processing, errors } = useForm({ nik: auth.user.profile?.nik || '', full_name: auth.user.profile?.full_name || '', email: auth.user.email || '', username: auth.user.username || '', phone_number: auth.user.profile?.phone_number || '', birth_place: auth.user.profile?.birth_place || '', birth_date: auth.user.profile?.birth_date || '', address: auth.user.profile?.address || '', }); const onSubmit = (e: React.FormEvent) => { e.preventDefault(); patch(ProfileController.update().url, { preserveScroll: true, onSuccess: (response: any) => { toast.success(response.props.flash.success || 'Profil berhasil diperbarui.'); }, }); }; return (