import './Table.scss'; // import Checkbox from '../Checkbox'; import { isFunction } from '../../assets/utils/functionUtils'; import classNames from 'classnames'; import { ColumnsProps, DataProps, TableProps } from './Types'; import { prepareData } from '../../utils/TableCell/TableCell'; // import NoData from '../NoData/NoData'; const Table = ({ data = [], columns = [], headerType, // withCheckbox, // onSelect, // allSelected, // partialSelected = false, withFixedHeader = true, borderWithRadius = false, // headerCheckboxDisabled = false, // noDataContent, // noDataImage, // noDataImageSize, height = '100%', className = '', }: TableProps) => { const hanleOnclick = (column: ColumnsProps, row: DataProps) => { let { onClick, accessor } = column; if (onClick && isFunction(onClick)) { onClick(accessor, row); } }; if (!(data.length >= 0)) return null; return (
|
{/* {index === 0 && withCheckbox && (
|
))}
|---|
| hanleOnclick(column, row)}
className={classNames(column.className, {
'clickable-cell': column.onClick,
})}
>
{/* {i === 0 && withCheckbox && (
|
);
})}