-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
/
TableFooter.js
53 lines (46 loc) · 1.29 KB
/
TableFooter.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import Tablelvl2Context from '../Table/Tablelvl2Context';
export const styles = {
/* Styles applied to the root element. */
root: {
display: 'table-footer-group',
},
};
const tablelvl2 = {
variant: 'footer',
};
const TableFooter = React.forwardRef(function TableFooter(props, ref) {
const { classes, className, component: Component, ...other } = props;
return (
<Tablelvl2Context.Provider value={tablelvl2}>
<Component className={clsx(classes.root, className)} ref={ref} {...other} />
</Tablelvl2Context.Provider>
);
});
TableFooter.propTypes = {
/**
* The content of the component, normally `TableRow`.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The component used for the root node.
* Either a string to use a DOM element or a component.
*/
component: PropTypes.elementType,
};
TableFooter.defaultProps = {
component: 'tfoot',
};
export default withStyles(styles, { name: 'MuiTableFooter' })(TableFooter);