"use client"; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Cell, } from "recharts"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface BarChartProps { data: Array<{ name: string; value: number; [key: string]: any }>; title?: string; dataKey?: string; colors?: string[]; 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 ModernBarChart({ data, title, dataKey = "value", colors = [ "rgb(37, 99, 235)", // Blue (primary) "rgb(107, 114, 128)", // Gray "rgb(236, 72, 153)", // Pink "rgb(34, 197, 94)", // Lime green "rgb(168, 85, 247)", // Purple ], height = 300, className, }: BarChartProps) { return ( {title && ( {title} )} } /> {data.map((entry, index) => ( ))} ); }