import * as React         from 'react';
import { TableBodyProps } from 'react-table';
import { SizeType }       from '../../../util/global-props';
import { Wrapper }        from '../../wrapper/wrapper.component';
import { tableClassName } from '../utils';

const className = tableClassName('tbody');

type PropsType = {
    children?: React.ReactNode;
    tBodyProps?: TableBodyProps;

    padding?: SizeType;
    style?: React.CSSProperties;
}

export const TableBody = React.memo((props: PropsType) => (
    <Wrapper
        className={ className }
        padding={ props.padding }
        style={ props.style }
        { ...props.tBodyProps }
    >
        { props.children }
    </Wrapper>
));
