"use client"; import { useId } from "react"; import { Area, AreaChart, CartesianGrid, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; interface LineChartData { date: string; value: number; [key: string]: string | number; } interface LineChartInnerProps { data: LineChartData[]; dataKey: string; color: string; gradient: boolean; height: number; } interface TooltipProps { active?: boolean; payload?: Array<{ value: number; name?: string }>; label?: string; } const CustomTooltip = ({ active, payload, label }: TooltipProps) => { if (active && payload && payload.length) { return (

{label}

{payload[0].value} {" "} sessions

); } return null; }; export default function LineChartInner({ data, dataKey, color, gradient, height, }: LineChartInnerProps) { const gradientId = useId(); const ChartComponent = gradient ? AreaChart : LineChart; return ( {gradient && ( )} } /> {gradient ? ( ) : ( )} ); }