import * as classNames from 'classnames'; import * as React from 'react'; import { NBSP } from '../../constants'; import { TableCellPropsBase, OptionalComponentPropAndHTMLAttributes, } from '../../types'; import { shouldNotBeRendered } from '../../utils'; export type TableCellProps = TableCellPropsBase & React.TdHTMLAttributes & OptionalComponentPropAndHTMLAttributes; /** * Table cell component with additional styles & functionality, used within table rows. * See the [Table](#table) section for a full example. */ const TableCell = (props: TableCellProps) => { const { className, children, style, width, component: Component = 'td', ...remainingProps } = props; return ( {shouldNotBeRendered(children) ? NBSP : children} ); }; export default React.memo(TableCell);