/* eslint-disable react/prop-types */ import React from "react"; export default function CenterGrowSlider({ value, min = -50, max = 50, backgroundColor = "rgba(150,150,150,0.3)", height = 8, }) { // Clamp the value const clamped = Math.max(min, Math.min(max, value)); const range = max - min; const halfRange = range / 2; const magnitude = Math.abs(clamped) / halfRange; // 0..1 // Calculate widths (each bar maxes out at 50% width) const positiveWidth = clamped > 0 ? magnitude * 50 : 0; const negativeWidth = clamped < 0 ? magnitude * 50 : 0; const baseStyle = { position: "absolute", top: "50%", height: `${height}px`, transform: "translateY(-50%)", }; return (