forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.js
34 lines (27 loc) · 1.13 KB
/
table.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
import React from 'react';
import classnames from 'classnames';
export const KuiTable = ({ children }) => <table className="kuiTable">{children}</table>;
KuiTable.propTypes = { children: React.PropTypes.node };
export const KuiTHead = ({ children }) => <thead>{children}</thead>;
KuiTHead.propTypes = { children: React.PropTypes.node };
export const KuiTBody = ({ children }) => <tbody>{children}</tbody>;
KuiTBody.propTypes = { children: React.PropTypes.node };
export const KuiTr = ({ children }) => <tr className="kuiTableRow">{children}</tr>;
KuiTr.propTypes = { children: React.PropTypes.node };
export function KuiTh({ children, className, onClick }) {
return <th className={classnames('kuiTableHeaderCell', className)} onClick={() => { if (onClick) onClick(); } }>
{children}
</th>;
}
KuiTh.propTypes = {
children: React.PropTypes.node,
className: React.PropTypes.string,
onClick: React.PropTypes.func
};
export function KuiTd({ children, className }) {
return <td className={classnames('kuiTableRowCell', className)}>{children}</td>;
}
KuiTd.propTypes = {
children: React.PropTypes.node,
className: React.PropTypes.string
};