@appbuckets/react-ui
Version:
Just Another React UI Framework
41 lines (38 loc) • 979 B
JavaScript
import { useRxTable } from '../RxTable.context.js';
import TableCell from '../../Table/TableCell.js';
/* --------
* Component Definition
* -------- */
var RxTableFooterCell = function (props) {
var className = props.className,
column = props.column,
isVirtualized = props.isVirtualized,
style = props.style;
// ----
// Get Table Data
// ----
var _a = useRxTable(),
tableData = _a.tableData,
data = _a.data,
selectedData = _a.selection.selectedData;
// ----
// Component Render
// ----
return TableCell.create(
typeof column.footer === 'function'
? column.footer(tableData, selectedData, data)
: column.footer || '',
{
autoGenerateKey: false,
defaultProps: {
className: className,
},
overrideProps: {
as: isVirtualized ? 'div' : 'td',
style: style,
},
}
);
};
RxTableFooterCell.displayName = 'RxTableFooterCell';
export { RxTableFooterCell as default };