import { motion } from "framer-motion"; import { GitCommit, GitMerge, CircleDot, Users, TrendingUp } from "lucide-react"; import { useEffect, useState } from "react"; interface Props { stats: { commitsToday?: number; prsMerged?: number; issuesClosed?: number; activeUsers?: number; }; } function AnimatedNumber({ value }: { value: number }) { const [display, setDisplay] = useState(0); useEffect(() => { const duration = 1000; const start = Date.now(); const startVal = display; const tick = () => { const elapsed = Date.now() - start; const progress = Math.min(elapsed / duration, 1); const eased = 1 - Math.pow(1 - progress, 3); setDisplay(Math.floor(startVal + (value - startVal) * eased)); if (progress < 1) requestAnimationFrame(tick); }; requestAnimationFrame(tick); }, [value]); return <>{display.toLocaleString()}>; } const widgets = [ { icon: GitCommit, label: "Commits Today", key: "commitsToday", color: "from-green-400 to-emerald-500", iconColor: "text-green-400", bgGlow: "bg-green-500/20" }, { icon: GitMerge, label: "PRs Merged", key: "prsMerged", color: "from-purple-400 to-violet-500", iconColor: "text-purple-400", bgGlow: "bg-purple-500/20" }, { icon: CircleDot, label: "Issues Closed", key: "issuesClosed", color: "from-orange-400 to-amber-500", iconColor: "text-orange-400", bgGlow: "bg-orange-500/20" }, { icon: Users, label: "Active Users", key: "activeUsers", color: "from-cyan-400 to-blue-500", iconColor: "text-cyan-400", bgGlow: "bg-cyan-500/20" } ]; export default function QuickStatsRow({ stats }: Props) { // Use real data from API only, default to 0 const data = { commitsToday: stats.commitsToday ?? 0, prsMerged: stats.prsMerged ?? 0, issuesClosed: stats.issuesClosed ?? 0, activeUsers: stats.activeUsers ?? 0 }; return (