This commit is contained in:
Dominik Klarkowski
2026-06-18 12:23:05 +02:00
parent 63cb8b4933
commit bf8624c954
4 changed files with 101 additions and 75 deletions

View File

@@ -16,9 +16,10 @@ type GcbPoint = { distanceKm: number; left: number; right: number };
type Props = {
data: GcbPoint[];
syncId?: string;
};
export function GcbChart({ data }: Props) {
export function GcbChart({ data, syncId }: Props) {
const uid = useId();
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
@@ -41,7 +42,7 @@ export function GcbChart({ data }: Props) {
</span>
</div>
<ResponsiveContainer width="100%" height={120}>
<AreaChart data={data} margin={{ top: 4, right: 8, left: 0, bottom: 0 }}>
<AreaChart syncId={syncId} data={data} margin={{ top: 4, right: 8, left: 0, bottom: 0 }}>
<defs>
<linearGradient id={`gcb-l-${uid}`} x1="0" y1="0" x2="0" y2="1">
<stop offset="5%" stopColor="var(--color-accent)" stopOpacity={0.2} />