"use client"; import { Area, AreaChart, Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; import type { DailyPoint, GameReportRow, ScrollBucket } from "@/lib/analytics/queries"; /** * Recharts panels for the analytics admin view. Kept as tiny client islands: * the surrounding view (tabs, tables, filters) renders server-side. Colors * are explicit hex values because the Payload admin panel does not define the * frontend chart CSS variables. */ const AXIS_STYLE = { fill: "#a3a3a3", fontSize: 11 } as const; interface TooltipEntry { name?: string | number; value?: string | number; color?: string; } function AdminTooltip({ active, payload, label, labelFormatter, }: { active?: boolean; payload?: TooltipEntry[]; label?: string | number; labelFormatter?: (label: string | number) => string; }) { if (!active || !payload || payload.length === 0) return null; return (
{labelFormatter && label !== undefined ? labelFormatter(label) : label}
{payload.map((entry, index) => ({entry.name} {entry.value}
))}