import React from 'react'; import PropTypes from 'prop-types'; const CellWrap = ({ value }, formatValue, formatTitle = formatValue) => { if (!value) { return '–'; } const cellValue = typeof formatValue === 'function' ? formatValue(value) : value; const cellTitle = typeof formatTitle === 'function' ? formatTitle(value) : value; return (
{cellValue}
); }; CellWrap.propTypes = { value: PropTypes.oneOfType([ PropTypes.string, PropTypes.number, ]), formatValue: PropTypes.func, formatTitle: PropTypes.func, }; export default CellWrap;