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

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

const TableFoot = (props: TableFootProps) => {
    const { children, className } = props;

    const attributes = Object.assign({}, props);

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

    return (
        <tfoot {...attributes} className={twMerge(classesMerged)}>
            {children}
        </tfoot>
    );
};

TableFoot.displayName = 'TableFoot';

export default TableFoot;
