'use client' import { zodResolver } from "@hookform/resolvers/zod"; import { Button } from '@nextui-org/button'; import { Input } from '@nextui-org/input'; import { Select, SelectItem, SelectSection } from '@nextui-org/react'; import React, { useState } from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { EyeFilledIcon, EyeSlashFilledIcon } from '../icons'; import Datepicker from "react-tailwindcss-datepicker"; const schema = z.object({ name: z.string().min(3).max(50), email: z.string().email(), }); interface FormData { name: string; email: string; } const FormApplication: React.FC = () => { const [isVisible, setIsVisible] = React.useState(false); const [selectedGender, setSelectedGender] = React.useState(''); const [startDateValue, setStartDateValue] = useState({ startDate: null, endDate: null, }); const toggleVisibility = () => setIsVisible(!isVisible); const { register, handleSubmit, formState: { errors } } = useForm({ resolver: zodResolver(schema), }); const onChangeGender = (selectedItem: any) => { setSelectedGender(selectedItem); // Lakukan apa pun yang perlu dilakukan saat pilihan jenis kelamin berubah di sini console.log("Selected Gender:", selectedItem); }; const handleValueChange = (newValue: any, num: any) => { console.log("start:", newValue); setStartDateValue(newValue); } const onSubmit = (data: FormData) => { console.log(data); }; return ( //
//
// // // {errors.name &&

{errors.name.message}

} //
//
// // // {errors.email &&

{errors.email.message}

} //
// //
Form Register Permohonan
{isVisible ? ( ) : ( )} } type={isVisible ? "text" : "password"} label="Password" placeholder="Masukkan password anda" variant='underlined' />
{isVisible ? ( ) : ( )} } type={isVisible ? "text" : "password"} label="Konfirmasi Password" placeholder="Masukkan password anda" variant='underlined' />
handleValueChange(e, 1)} inputClassName="w-full bg-transparent border-1 border-gray-200 px-2 py-[6px] rounded-xl " />
); }; export default FormApplication;