+ {peaks.map((peak, i) => {
+ let height = Math.max(BAR_MIN_HEIGHT, BAR_MAX_HEIGHT * peak);
+ const highlight = i < peakPosition;
+
+ // Use maximum height for current audio position
+ if (highlight && i + 1 >= peakPosition) {
+ height = BAR_MAX_HEIGHT;
+ }
+
+ const key = i;
+
+ return (
+
+ );
+ })}
+