"use client"; import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead"; import { useWrStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common/type/header"; import type { } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList"; import { InputTableBody } from "@/components/lib/func/TableData"; import { Input, Table, TableBody, TableCell, TableHeader, TableRow, } from "@common/components/ui"; import { useEffect, useState, type Dispatch, type SetStateAction } from "react"; export function GuideDetailsTable({ chgRes, headList, upheadList, type, setChGuidData, }: { chgRes: any[]; headList: TableUpperProps[]; upheadList:chHeadType[] type: string; setChGuidData: (chgRes: any[]) => void; }) { const { code, rainChkgdn } = useWrStore((state) => state); const [inputData, setInputData] = useState(); useEffect(() => { setInputData(chgRes); }, [chgRes]); useEffect(() => { setChGuidData(inputData??[] ); }, [inputData]); return ( <>
{headMakeprfmnc(headList, upheadList)} {InputTableBody(inputData ?? [],headList, setInputData) }
); }