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/lecturers'; import { Form, Head } from '@inertiajs/react'; import { format } from 'date-fns'; import { useState } from 'react'; type Department = { id: number; name: string }; 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; lecturer: { lecturer_number: string; department_id: number } | null; }; type Props = { user: User; departments: Department[]; }; export default function LecturerEdit({ user, departments }: Props) { const [gender, setGender] = useState(user.profile?.gender ?? ''); const [birthDate, setBirthDate] = useState( user.profile?.birth_date ? new Date(user.profile.birth_date) : undefined ); return ( <>
Kembali } />
{({ errors, processing }) => ( <> Informasi Akun
Profil Pribadi