UNPKG

@mrii/react-table-builder

Version:
26 lines (23 loc) 908 B
import { jsx } from 'react/jsx-runtime'; import { memo } from 'react'; import { Check, Close } from '@mui/icons-material'; import { omitNil } from '../../../utils/omit-nil/index.mjs'; import { useAddTableColumn } from '../../../hooks/use-add-table-column/index.mjs'; const booleanRenderCell = ({ checkIconProps , closeIconProps })=>({ value })=>omitNil(value, value ? /*#__PURE__*/ jsx(Check, { ...checkIconProps }) : /*#__PURE__*/ jsx(Close, { ...closeIconProps })); const BooleanColumn = /*#__PURE__*/ memo(function BooleanColumn({ checkIconProps , closeIconProps , ...props }) { useAddTableColumn({ type: 'boolean', renderCell: booleanRenderCell({ checkIconProps, closeIconProps }), ...props }); return null; }); export { BooleanColumn, booleanRenderCell }; //# sourceMappingURL=index.mjs.map