const Indicator = ({ value, max = 6 }) => (
<div>
{Array.from({ length: max }, (_, i) => (
<div className={`indicator-cell ${i < value ? 'active' : ''}`}></div>
))}
</div>
);
.indicator-cell {
background: white;
}
.indicator-cell.active {
background: red;
}
<Indicator value={4} />
<Indicator value={1} />
<Indicator value={8} max={12} />