From 1d22dc8b25027a5fa39da6ae5d27bc1cb99da4c0 Mon Sep 17 00:00:00 2001 From: Daniel Ringel <33063149+dringel@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:42:56 -0500 Subject: [PATCH] fixed incompatibility --- components/ui/chart.tsx | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/components/ui/chart.tsx b/components/ui/chart.tsx index 8b42f21..2bbcd3e 100644 --- a/components/ui/chart.tsx +++ b/components/ui/chart.tsx @@ -3,6 +3,7 @@ import * as React from "react" import * as RechartsPrimitive from "recharts" + import { cn } from "@/lib/utils" // Format: { THEME_NAME: CSS_SELECTOR } @@ -104,6 +105,19 @@ ${colorConfig const ChartTooltip = RechartsPrimitive.Tooltip +type ChartTooltipContentProps = React.ComponentProps<"div"> & + Omit, "content"> & { + active?: boolean + payload?: any[] + label?: any + hideLabel?: boolean + hideIndicator?: boolean + indicator?: "line" | "dot" | "dashed" + nameKey?: string + labelKey?: string + } + + function ChartTooltipContent({ active, payload, @@ -118,14 +132,9 @@ function ChartTooltipContent({ color, nameKey, labelKey, -}: React.ComponentProps & - React.ComponentProps<"div"> & { - hideLabel?: boolean - hideIndicator?: boolean - indicator?: "line" | "dot" | "dashed" - nameKey?: string - labelKey?: string - }) { +}: ChartTooltipContentProps) { + + const { config } = useChart() const tooltipLabel = React.useMemo(() => { @@ -258,11 +267,13 @@ function ChartLegendContent({ payload, verticalAlign = "bottom", nameKey, -}: React.ComponentProps<"div"> & - Pick & { - hideIcon?: boolean - nameKey?: string - }) { +}: React.ComponentProps<"div"> & { + payload?: any[] + verticalAlign?: "top" | "middle" | "bottom" + hideIcon?: boolean + nameKey?: string +}) { + const { config } = useChart() if (!payload?.length) {