import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"; import { AreaChart, Area, XAxis, YAxis, CartesianGrid } from "recharts"; import { MemoryStick } from "lucide-react"; import { useChartConfig } from "./chartConfig"; import { formatBytes } from "./dataUtils"; interface MemoryChartsProps { data: any[]; } export const MemoryCharts = ({ data }: MemoryChartsProps) => { const { chartConfig, getGridColor, getAxisColor } = useChartConfig(); return (
Memory Usage
} cursor={{ stroke: '#10b981', strokeWidth: 2, strokeOpacity: 0.5 }} />
Memory Usage (Bytes)
formatBytes(value)} /> } cursor={{ stroke: '#10b981', strokeWidth: 2, strokeOpacity: 0.5 }} formatter={(value, name) => [ name === 'Used Memory' ? formatBytes(Number(value)) : name === 'Total Memory' ? formatBytes(Number(value)) : value, name ]} />
); };