// Light Bump Bars // Purpose: Defines the Light Bump Bars module and the local helpers/components used in this file. // Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit. import React from 'react'; function LightBumpBars({ sensors }) { const values = [ sensors?.lightBumpLeftSignal, sensors?.lightBumpFrontLeftSignal, sensors?.lightBumpCenterLeftSignal, sensors?.lightBumpCenterRightSignal, sensors?.lightBumpFrontRightSignal, sensors?.lightBumpRightSignal, ]; const max = values.filter((v) => v != null).reduce((acc, v) => Math.max(acc, v), 1200); const eased = (v) => Math.pow(Math.max(0, Math.min(1, (v ?? 0) / max)), 0.35); const hueFor = (v) => { if (v == null || v <= 0) return 'hsl(200 60% 18%)'; const h = (200 + eased(v) * 360) % 360; return `hsl(${h} 100% 60%)`; }; const segments = 6; const barHeight = 12; return (