"use client"; import { useEffect, useState } from "react"; interface PointsDisplayProps { points: number; size?: "small" | "medium" | "large"; } export default function PointsDisplay({ points, size = "medium" }: PointsDisplayProps) { const [displayPoints, setDisplayPoints] = useState(0); useEffect(() => { const duration = 1000; const steps = 30; const increment = points / steps; let current = 0; let step = 0; const timer = setInterval(() => { step++; current += increment; if (step >= steps) { setDisplayPoints(points); clearInterval(timer); } else { setDisplayPoints(Math.floor(current)); } }, duration / steps); return () => clearInterval(timer); }, [points]); const sizeClasses = { small: "text-lg", medium: "text-3xl", large: "text-5xl", }; const iconSizes = { small: "w-6 h-6", medium: "w-10 h-10", large: "w-16 h-16", }; return (

Your Points

{displayPoints.toLocaleString()}

); }