"use client"; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Area, AreaChart, } from "recharts"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface LineChartProps { data: Array<{ date: string; value: number; [key: string]: any }>; title?: string; dataKey?: string; color?: string; gradient?: boolean; height?: number; className?: string; } const CustomTooltip = ({ active, payload, label }: any) => { if (active && payload && payload.length) { return (

{label}

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

); } return null; }; export default function ModernLineChart({ data, title, dataKey = "value", color = "hsl(var(--primary))", gradient = true, height = 300, className, }: LineChartProps) { const ChartComponent = gradient ? AreaChart : LineChart; return ( {title && ( {title} )} {gradient && ( )} } /> {gradient ? ( ) : ( )} ); }