import style from '../../../style';
import { twMerge } from 'tailwind-merge';

export interface TableBodyProps
    extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement> {
    children?: React.ReactNode;
    className?: string;
}

const TableBody = (props: TableBodyProps) => {
    const { children, className } = props;

    const initialCss = style.table.body;
    const classesMerged = `${initialCss} ${className ? className : ''}`;

    return (
        <tbody {...props} className={twMerge(classesMerged)}>
            {children}
        </tbody>
    );
};

TableBody.displayName = 'TableBody';

export default TableBody;
