Repository URL to install this package:
Version:
0.9.5 ▾
|
import React from 'react'
import { StyledCell, StyledInnerCell } from './styled'
import { CellProps } from './typings'
class Cell extends React.PureComponent<CellProps> {
static defaultProps = {
// nowrap: true,
}
render() {
const { children, colSpan, totalColumns, className, nowrap } = this.props
const attributes = { className, colSpan, totalColumns }
// @todo render prop
const Box = nowrap ? React.Fragment : StyledInnerCell
return (
<StyledCell {...attributes}>
<Box>{children}</Box>
</StyledCell>
)
}
}
export { Cell }
export default Cell