import { Metric } from '@/lib/db/models/metric'; import { ChartTooltip, LineChart } from '@mantine/charts'; import { Paper, Title } from '@mantine/core'; export default function FilesUrlsCountGraph({ metrics }: { metrics: Metric[] }) { const sortedMetrics = metrics.sort( (a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime(), ); return ( Count ({ date: new Date(metric.createdAt).getTime(), files: metric.data.files, urls: metric.data.urls, }))} series={[ { name: 'files', label: 'Files', color: 'blue', }, { name: 'urls', label: 'URLs', color: 'green', }, ]} dataKey='date' curveType='natural' lineChartProps={{ syncId: 'datedStatistics' }} xAxisProps={{ tickFormatter: (v) => new Date(v).toLocaleString(), }} tooltipProps={{ content: ({ label, payload }) => ( ), }} connectNulls withDots={false} /> ); }