11"use client"
22
33import * as React from "react"
4- import * as RechartsPrimitive from "recharts"
4+ import { ResponsiveContainer , Tooltip , Legend , type LegendProps } from "recharts"
55
66import { cn } from "@/lib/utils"
77
@@ -43,7 +43,7 @@ function ChartContainer({
4343} : React . ComponentProps < "div" > & {
4444 config : ChartConfig
4545 children : React . ComponentProps <
46- typeof RechartsPrimitive . ResponsiveContainer
46+ typeof ResponsiveContainer
4747 > [ "children" ]
4848} ) {
4949 const uniqueId = React . useId ( )
@@ -61,9 +61,9 @@ function ChartContainer({
6161 { ...props }
6262 >
6363 < ChartStyle id = { chartId } config = { config } />
64- < RechartsPrimitive . ResponsiveContainer >
64+ < ResponsiveContainer >
6565 { children }
66- </ RechartsPrimitive . ResponsiveContainer >
66+ </ ResponsiveContainer >
6767 </ div >
6868 </ ChartContext . Provider >
6969 )
@@ -102,7 +102,7 @@ ${colorConfig
102102 )
103103}
104104
105- const ChartTooltip = RechartsPrimitive . Tooltip
105+ const ChartTooltip = Tooltip
106106
107107function ChartTooltipContent ( {
108108 active,
@@ -118,7 +118,7 @@ function ChartTooltipContent({
118118 color,
119119 nameKey,
120120 labelKey,
121- } : React . ComponentProps < typeof RechartsPrimitive . Tooltip > &
121+ } : React . ComponentProps < typeof Tooltip > &
122122 React . ComponentProps < "div" > & {
123123 hideLabel ?: boolean
124124 hideIndicator ?: boolean
@@ -250,7 +250,7 @@ function ChartTooltipContent({
250250 )
251251}
252252
253- const ChartLegend = RechartsPrimitive . Legend
253+ const ChartLegend = Legend
254254
255255function ChartLegendContent ( {
256256 className,
@@ -259,7 +259,7 @@ function ChartLegendContent({
259259 verticalAlign = "bottom" ,
260260 nameKey,
261261} : React . ComponentProps < "div" > &
262- Pick < RechartsPrimitive . LegendProps , "payload" | "verticalAlign" > & {
262+ Pick < LegendProps , "payload" | "verticalAlign" > & {
263263 hideIcon ?: boolean
264264 nameKey ?: string
265265 } ) {
0 commit comments