import React, { ReactNode, TdHTMLAttributes, HTMLAttributes } from "react";
// Props for Table
interface TableProps extends HTMLAttributes {
children: ReactNode;
}
// Props for TableHeader
interface TableHeaderProps extends HTMLAttributes {
children: ReactNode;
}
// Props for TableBody
interface TableBodyProps extends HTMLAttributes {
children: ReactNode;
}
// Props for TableRow
interface TableRowProps extends HTMLAttributes {
children: ReactNode;
}
// Props for TableCell - Hỗ trợ colSpan, rowSpan...
interface TableCellProps extends TdHTMLAttributes {
children: ReactNode;
isHeader?: boolean;
}
// Table Component
const Table: React.FC = ({ children, className, ...props }) => {
return ;
};
// TableHeader Component
const TableHeader: React.FC = ({ children, className, ...props }) => {
return {children};
};
// TableBody Component
const TableBody: React.FC = ({ children, className, ...props }) => {
return {children};
};
// TableRow Component
const TableRow: React.FC = ({ children, className, ...props }) => {
return {children}
;
};
// TableCell Component
const TableCell: React.FC = ({
children,
isHeader = false,
className,
...props
}) => {
const CellTag = isHeader ? "th" : "td";
return (
{children}
);
};
export { Table, TableHeader, TableBody, TableRow, TableCell };