tabledata로 변수 명 변경, 페이지 네이션 unvisible 추가
This commit is contained in:
@@ -4,7 +4,7 @@ import UiPageNations from "./uiPageNations";
|
||||
|
||||
type UiTableProps = {
|
||||
headName: React.ReactNode|undefined;
|
||||
publicReuseFacility: { [key: string]: string | number | boolean }[];
|
||||
tableData: { [key: string]: string | number | boolean }[];
|
||||
headlist: UiHeadProps[];
|
||||
pageSize: number;
|
||||
total: number;
|
||||
@@ -16,7 +16,7 @@ type UiHeadProps={
|
||||
title:string;
|
||||
|
||||
}
|
||||
export function UiTable({ publicReuseFacility, headlist,pageSize , total, children,headName}: UiTableProps) {
|
||||
export function UiTable({ tableData, headlist,pageSize , total, children,headName}: UiTableProps) {
|
||||
const cur = 1;
|
||||
|
||||
return (
|
||||
@@ -25,14 +25,14 @@ export function UiTable({ publicReuseFacility, headlist,pageSize , total, childr
|
||||
<Table>
|
||||
<TableHeader>
|
||||
{children? <>{children}</>:<TableRow>
|
||||
{headlist.map((head) => (
|
||||
{headlist?.map((head) => (
|
||||
<TableHead key={head.id}>{head.title}</TableHead>
|
||||
))}
|
||||
</TableRow>}
|
||||
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{publicReuseFacility.map((el: { [key: string]: string | number | boolean },index) => (
|
||||
<TableBody className='text-center'>
|
||||
{tableData?.map((el: { [key: string]: string | number | boolean },index) => (
|
||||
<TableRow key={index+"row"} >
|
||||
{headlist.map((head) => (
|
||||
<TableCell key={head.id+index}>{el[head.id]}</TableCell>
|
||||
@@ -43,7 +43,7 @@ export function UiTable({ publicReuseFacility, headlist,pageSize , total, childr
|
||||
</TableBody>
|
||||
|
||||
</Table>
|
||||
<UiPageNations total={total} cur={cur} pageSize={pageSize} />
|
||||
{total <=0? <></>: <UiPageNations total={total} cur={cur} pageSize={pageSize} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user