2017-01-19 16:59:59 +02:00
|
|
|
const composers = require('../../shared/composers');
|
|
|
|
|
|
|
|
const React = require('react');
|
|
|
|
const Styled = require('styled-components');
|
|
|
|
|
|
|
|
const {
|
|
|
|
default: styled,
|
|
|
|
} = Styled;
|
|
|
|
|
|
|
|
const {
|
2017-02-15 03:19:26 +02:00
|
|
|
clearfix,
|
|
|
|
Baseline
|
2017-01-19 16:59:59 +02:00
|
|
|
} = composers;
|
|
|
|
|
|
|
|
const StyledTableBody = styled.article`
|
|
|
|
box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.05);
|
2017-02-15 03:19:26 +02:00
|
|
|
|
2017-01-19 16:59:59 +02:00
|
|
|
${clearfix}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const TableBody = ({
|
|
|
|
children
|
|
|
|
}) => {
|
|
|
|
const itemCount = children.length;
|
|
|
|
|
2017-02-15 03:19:26 +02:00
|
|
|
if (itemCount <= 1) {
|
|
|
|
return null;
|
|
|
|
}
|
2017-01-19 16:59:59 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<StyledTableBody itemCount={itemCount}>
|
|
|
|
{children}
|
|
|
|
</StyledTableBody>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
TableBody.propTypes = {
|
|
|
|
children: React.PropTypes.node
|
|
|
|
};
|
|
|
|
|
2017-02-15 03:19:26 +02:00
|
|
|
module.exports = Baseline(
|
|
|
|
StyledTableBody
|
|
|
|
);
|