"use client"
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"
import { Progress } from "@/components/ui/progress"
import {
BarChart3,
TrendingUp,
TrendingDown,
Users,
Play,
Star,
GitFork,
Eye,
Clock,
Zap
} from "lucide-react"
interface AnalyticsStat {
label: string
value: string | number
change?: number
changeLabel?: string
icon: React.ReactNode
}
interface EnhancedAnalyticsProps {
stats: {
totalRuns: number
totalStars: number
totalRemixes: number
totalViews: number
averageResponseTime: number
tokenUsage: number
topPrompts: { title: string; runs: number; stars: number }[]
runsByDay: { date: string; runs: number }[]
modelUsage: { model: string; percentage: number }[]
}
}
export function EnhancedAnalytics({ stats }: EnhancedAnalyticsProps) {
const mainStats: AnalyticsStat[] = [
{
label: "Total Runs",
value: stats.totalRuns.toLocaleString(),
change: 12.5,
changeLabel: "vs last week",
icon:
{stat.value}
{stat.label}
{stats.averageResponseTime < 2000 ? "Excellent" : stats.averageResponseTime < 4000 ? "Good" : "Needs improvement"}
Above average efficiency
{prompt.title}