"use client"; import { headMakeColSpan } from "@/app/ruseFcltMng/fcltReg/rainReg/page"; import { useWrStore } from "@/app/store"; import { selectClass, type bdstType, } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { ScrollArea, SearchInput, SelectBox, UiTable } from "@common/business_components"; import { Button, Input } from "@common/components"; import { useEffect, useState } from "react"; import { RainRegForm } from "../../form/fcltReg/rainReg/component"; export function BdstReg() { const { rain, code, init } = useWrStore((state) => { return state; }); const [bdstTable, setbdstTable] = useState(); const [rainBdstForm, setRainBdstForm] = useState<[]>(); const { bdstObj, rainRuseObj } = rain; const getCity = (val: string | number) => { console.log(val); }; const getSgg = (val: string | number) => { console.log(val); }; useEffect(() => { if (code.sggCd.length > 0) { const table = bdstObj.map((item) => { const sggText = code.sggCd.find( (cd) => cd.val.toString() === item.sggCd )?.text; const cityText = code.cityCd.find( (cd) => cd.val.toString() === item.ctpvCd )?.text; return { ...item, sggText: sggText, cityText: cityText }; }); setbdstTable(table); } }, [code, bdstObj]); const cellClick = () => {}; const nodeList = headMakeColSpan(rain.upHeadList); return ( <>
{" "} {" "}
{nodeList}
); }