"use client";
import * as React from "react";
import { cn } from "@/lib/utils";
interface TableProps extends React.ComponentProps<"table"> {
noWrapper?: boolean;
divClassName?: string;
}
function Table({ className, noWrapper, divClassName, ...props }: TableProps) {
// noWrapper 여부 관계없이 wrapper를 제거하여 sticky header가 부모 overflow-auto 기준으로 동작하도록 함
// 가로 스크롤은 부모의 overflow-auto에서 처리
return
;
}
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
return ;
}
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
return ;
}
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
return (
);
}
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
return (
);
}
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
return (
[role=checkbox]]:translate-y-[2px]",
className,
)}
{...props}
/>
);
}
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
return (
| [role=checkbox]]:translate-y-[2px]",
className,
)}
{...props}
/>
);
}
function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
return (
);
}
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|