"use client"; import { Bar, BarChart, Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; interface SecurityMetricsChartProps { data: Array<{ hour: number; count: number }>; type?: "line" | "bar"; title?: string; } export function SecurityMetricsChart({ data, type = "line", title, }: SecurityMetricsChartProps) { const chartData = data.map((item) => ({ hour: `${item.hour}:00`, count: item.count, })); const ChartComponent = type === "line" ? LineChart : BarChart; const DataComponent = type === "line" ? ( ) : ( ); return (
{title &&

{title}

} {DataComponent}
); }