"use client"; import { SelectBox } from "@common/business_components"; import { DatePicker, FileUpload, FormUi, UiTable } from "@common/business_components/ui"; import { Form, FormField } from "@common/business_components/ui/form"; import { Button, Input, TableHead, TableRow } from "@common/components"; import { zodResolver } from "@hookform/resolvers/zod"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; import { useWrStore } from "../../app/store/index"; import { selectClass, type TableUpperProps } from "@/app/store/rainReuseFacilityInsert"; const formSchema = z.object({ username: z.string().min(2).max(50), facilityName: z.string().min(2).max(50), }); const headMakeColSpan = (upHeadList: TableUpperProps[]) => { return (<> { upHeadList.map((head: TableUpperProps) => (!head.upSequnce ? {head.title} : head.upName === 'upChangeRe' && head.upSequnce === 1 ? {'운영대행기간'} : null))} {upHeadList.map((head: TableUpperProps) => (head.upName === 'upChangeRe' ? {head.title} : null))} >) } export function PublicReuseFaciltyFormInsert() { const { pubFac } = useWrStore((state) => state); const { pubMngUpHeadList, pubMngFacData,erctUswtrCd,cyclCd,seCd,buseCd,rprcsCd,buseMet,rprcLoCd} = pubFac; const nodeList = headMakeColSpan(pubMngUpHeadList); const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { username: "", }, }); // 2. Define a submit handler. function onSubmit(values: z.infer) { // Do something with the form values. // ✅ This will be type-safe and validated. console.log(values); } const onSelectValue=(val:string)=>{ console.log(val) } const [instlAprvDate, setInstlAprvDate] = useState(new Date()) const [bizCmcnDate, setBizCmcnDate] = useState(new Date()) const [files, setFiles] = useState(null); return ( ○ 재이용시설 운영정보 ( )} /> 신규등록 ( )} /> ( )} /> ○ 재이용시설 운영정보 추가등록 {nodeList} ○ 재이용수 공급 가능량 ( )} /> ( )} /> ( )} /> ( )} /> {/* 차수별 등록 현황 폼 */} ○ 차수별 하수처리수 재이용 시설 현황 등록차수 ( )} /> 신규등록 ♦︎하수처리수 재이용 시설 현황 사업개요{" "} 1. 현황 ( )} /> ( )} /> ( { if (date) setInstlAprvDate(date); } }} mode="single" {...field}/> )} /> ( )} /> 2. 사업비 ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> 재처리시설{" "} ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> 농축수관리{" "} ( )} /> ( )} /> ( )} /> ( )} /> ( )} /> ); }