import { DatePicker } from '@/components/date-picker';
import InputError from '@/components/input-error';
import { PageHeader } from '@/components/page-header';
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 { PhoneInput } from '@/components/ui/phone-input';
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { Textarea } from '@/components/ui/textarea';
import { index, update } from '@/routes/admin/users/students';
import { Form, Head } from '@inertiajs/react';
import { format } from 'date-fns';
import { useState } from 'react';
type Department = { id: number; name: string };
type Lecturer = { id: number; lecturer_number: string; user: { profile: { full_name: string } | null } | null };
type User = {
id: number;
username: string;
email: string;
profile: { full_name: string; phone_number: string; address: string; gender: string; birth_date: string; birth_place: string } | null;
student: { student_number: string; department_id: number; enrollment_year: number; academic_advisor_id: number; status: string | null } | null;
};
type Props = {
user: User;
departments: Department[];
lecturers: Lecturer[];
};
export default function StudentEdit({ user, departments, lecturers }: Props) {
const [gender, setGender] = useState(user.profile?.gender ?? '');
const [birthDate, setBirthDate] = useState