import { memo } from 'react'; import { formatNumber } from '@/utils/formatting'; type BarCellProps = { /** The raw numeric value to display. */ value: number; /** The highest value in the current dataset — used to compute the bar width. */ max: number; }; /** * Renders a table cell with a proportional background bar. * * The bar is an absolutely-positioned element behind the numeric text, giving * the reader an immediate visual sense of scale without obscuring the value. * * @param {Object} props - Component props. * @param {number} props.value - The cell value. * @param {number} props.max - The maximum value across all rows (used for scaling). * @return {JSX.Element} The bar cell. */ const BarCell = memo( ({ value, max }: BarCellProps ) => { const pct = 0 < max ? ( value / max ) * 100 : 0; return ( {/* Background scale bar. */} ); }); BarCell.displayName = 'BarCell'; export default BarCell;