@appbuckets/react-ui
Version:
Just Another React UI Framework
43 lines (39 loc) • 1.01 kB
JavaScript
;
var RxTable_context = require('../RxTable.context.js');
var TableCell = require('../../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 = RxTable_context.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';
module.exports = RxTableFooterCell;