import React from 'react'; import { motion } from 'framer-motion'; import { BookOpen, Database, Zap, Target, MousePointerClick } from 'lucide-react'; import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell, LineChart, Line, ScatterChart, Scatter, ZAxis } from 'recharts'; import { ANALYTICS_DATA, TOPIC_DISTRIBUTION, COLORS, PR_CURVE_DATA, EMBEDDING_DATA } from '../../constants'; export function StatCard({ i, stat }) { return (
{stat.label}

{stat.value}

{stat.trend} Since last epoch
); } export function OverviewTab({ isDarkMode, stats }) { return (
{/* Top Row: CTR + Precision + Latency */}
{[ { label: 'CTR (CLICK-THROUGH)', value: '24.8%', trend: '+1.2%', icon: MousePointerClick, color: 'text-brand', bg: 'bg-brand/5' }, { label: 'PRECISION INDEX', value: '0.982', trend: '+0.002', icon: Target, color: 'text-indigo-500', bg: 'bg-indigo-50' }, { label: 'LATENCY (AVG)', value: '84ms', trend: '-14ms', icon: Zap, color: 'text-amber-500', bg: 'bg-amber-50' }, ].map((stat, i) => ( ))}
{/* Middle Row: Query Trends + Topics */}
{/* Query Trends Chart */}

Query Trends

Daily search volume vs AI usage

Searches
AI Compute
{/* Density Chart (Topics) */}

Topics

{(stats?.topic_distribution || TOPIC_DISTRIBUTION).map((entry, index) => ( ))}
{(stats?.topic_distribution || TOPIC_DISTRIBUTION).map((topic, i) => (
{topic.name}
{topic.value}
))}
{/* Bottom Row: Relevance + Embedding Visualization */}
{/* PR Curve */}

Relevance

Precision-Recall Curve

{/* Embedding Scatter Plot */}

Embedding Visualization

2D PCA projection of vector space

d.cluster === 'Algebra')} fill="#534AB7" /> d.cluster === 'Calculus')} fill="#7C3AED" /> d.cluster === 'Statistics')} fill="#10B981" />
); }