diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 6a5033963..17360af12 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -3,29 +3,30 @@ import UiPageNations from "./uiPageNations"; interface UiTableProps { + headName: string; publicReuseFacility: any[]; headlist: { id: string; title: string; }[]; pageSize: number; total: number; + children: React.ReactNode|undefined; } export function UiTable(UiTableProps: UiTableProps) { - const { publicReuseFacility, headlist,pageSize , total} = UiTableProps; - let cur = 1; - + const { publicReuseFacility, headlist,pageSize , total, children,headName} = UiTableProps; + const cur = 1; return ( <> -

공공하수처리시설 목록

+

{headName}

- + {children? <>{children}: {headlist.map((head) => ( {head.title} ))} - - + } + {publicReuseFacility.map((el: any,index) => ( diff --git a/packages/common/business_components/src/ui/table/table.tsx b/packages/common/business_components/src/ui/table/table.tsx new file mode 100644 index 000000000..7f3502f8b --- /dev/null +++ b/packages/common/business_components/src/ui/table/table.tsx @@ -0,0 +1,117 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Table = React.forwardRef< + HTMLTableElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+
+ +)) +Table.displayName = "Table" + +const TableHeader = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableHeader.displayName = "TableHeader" + +const TableBody = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableBody.displayName = "TableBody" + +const TableFooter = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + tr]:last:border-b-0", + className + )} + {...props} + /> +)) +TableFooter.displayName = "TableFooter" + +const TableRow = React.forwardRef< + HTMLTableRowElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableRow.displayName = "TableRow" + +const TableHead = React.forwardRef< + HTMLTableCellElement, + React.ThHTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +TableHead.displayName = "TableHead" + +const TableCell = React.forwardRef< + HTMLTableCellElement, + React.TdHTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableCell.displayName = "TableCell" + +const TableCaption = React.forwardRef< + HTMLTableCaptionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +TableCaption.displayName = "TableCaption" + +export { + Table, + TableHeader, + TableBody, + TableFooter, + TableHead, + TableRow, + TableCell, + TableCaption, +}