Files
frontend/apps/wr/components/ui/modal/coMat/constCostFeeTable.tsx
T

61 lines
1.5 KiB
TypeScript

"use client";
import { useWrStore } from "@/app/store";
import { cmpttnHeadListExport } from "@/app/store/matDmd/coMatRvw/headList";
import { yearOptions } from "@/components/lib/func/commom";
import { SelectBox, UiTable } from "@common/business_components/ui";
import { Label } from "@common/components/ui";
import { useEffect, useState } from "react";
export function ConstCostFeeTable({
setReturnData,
}: {
setReturnData: (data: any) => void;
}) {
const { constCostRes,getConstCostFee } = useWrStore((state) => state);
const [year, setYear] = useState<string>(String(new Date().getFullYear()));
useEffect(() => {
getConstCostFee(year)
}, [year,getConstCostFee]);
useEffect(() => {
const tableData = constCostRes.map((item) => {})
console.log(' constCostRes : ', constCostRes);
},[constCostRes])
return (
<>
<h3 className="mt-4 ml-2 text-2xl font-medium text-label">
공사비 산정표 보기
</h3>
<hr />
<div className="flex items-center">
<Label className="text-xl text-gray-600">기준년도</Label>
<SelectBox
className="h-full text-2xl"
label=""
selectClass={"ml-4"}
selectArray={yearOptions}
value={year}
onSelectValue={(val: string | number) => setYear(String(val))}
/>
</div>
<UiTable
headName={""}
tableData={[]}
headlist={cmpttnHeadListExport}
pageSize={0}
total={0}
cellClick={() => {}}
onPageChange={() => {}}
/>
</>
);
}