Repository URL to install this package:
|
Version:
4.0.61 ▾
|
import React from 'react'
import { StyledCell, StyledInnerCell } from './styled'
import { CellProps } from './typings'
class Cell extends React.PureComponent<CellProps> {
static defaultProps = {
className: ''
}
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