"use client" import { Totals, DailyData } from '@/lib/types/ai' import { formatStreakCompact, computeStreak } from './utils' import type { ToolTheme } from '@/app/ai/theme' import { surfaces } from '@/lib/theme' interface StatsGridProps { totals: Totals daily: DailyData[] theme: ToolTheme } export default function StatsGrid({ totals, daily, theme }: StatsGridProps) { const activeDays = daily.filter(day => day.totalTokens > 0 || day.totalCost > 0) const streak = computeStreak(activeDays) return (

Total Cost

${totals.totalCost.toFixed(2)}

Total Tokens

{(totals.totalTokens / 1000000).toFixed(1)}M

Days Active

{activeDays.length} 🔥 {formatStreakCompact(streak)}

Avg Daily Cost

${(totals.totalCost / Math.max(daily.length, 1)).toFixed(2)}

) }