테이블 타이틀 노드 추가 및 headlist 인터페이스 수정

This commit is contained in:
leedj312
2025-03-07 13:03:09 +09:00
parent 0f1ff0ff68
commit 37c2901976
@@ -3,22 +3,26 @@ import UiPageNations from "./uiPageNations";
interface UiTableProps {
headName: string;
publicReuseFacility: any[];
headlist: { id: string; title: string; }[];
headName: React.ReactNode|undefined;
publicReuseFacility: { [key: string]: string | number | boolean }[];
headlist: UiHeadProps[];
pageSize: number;
total: number;
children: React.ReactNode|undefined;
}
export function UiTable(UiTableProps: UiTableProps) {
const { publicReuseFacility, headlist,pageSize , total, children,headName} = UiTableProps;
const cur = 1;
interface UiHeadProps{
id:string;
title:string;
}
export function UiTable({ publicReuseFacility, headlist,pageSize , total, children,headName}: UiTableProps) {
const cur = 1;
return (
<>
<p>{headName}</p>
{headName?headName:<></>}
<Table>
<TableHeader>
{children? <>{children}</>:<TableRow>
@@ -29,7 +33,7 @@ export function UiTable(UiTableProps: UiTableProps) {
</TableHeader>
<TableBody>
{publicReuseFacility.map((el: any,index) => (
{publicReuseFacility.map((el: { [key: string]: string | number | boolean },index) => (
<TableRow key={index+"row"} >
{headlist.map((head) => (
<TableCell key={head.id+index}>{el[head.id]}</TableCell>