"use client"; import { Bar, BarChart, CartesianGrid, Cell, ComposedChart, LabelList, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { CHART_TOOLTIP_STYLE } from "@/lib/chart-utils"; type DebChartRow = { name: string; cityId: string; hitRate: number; mae: number; days: number; }; type MuChartRow = { name: string; cityId: string; brierScore: number; hitRate: number; mae: number; days: number; }; const CHART_COLORS = { green: "#22c55e", yellow: "#eab308", red: "#ef4444", }; function hitColor(hitRate: number) { if (hitRate >= 80) return CHART_COLORS.green; if (hitRate >= 60) return CHART_COLORS.yellow; return CHART_COLORS.red; } function maeColor(mae: number) { if (mae <= 1.5) return CHART_COLORS.green; if (mae <= 2.5) return CHART_COLORS.yellow; return CHART_COLORS.red; } function brierColor(score: number) { if (score <= 0.1) return CHART_COLORS.green; if (score <= 0.25) return CHART_COLORS.yellow; return CHART_COLORS.red; } export function TrainingAccuracyCharts({ debChartData, muChartData, }: { debChartData: DebChartRow[]; muChartData: MuChartRow[]; }) { return ( <> {debChartData.length > 0 ? (