"use client"; import { motion } from "framer-motion"; import { useEffect, useState } from "react"; interface ScoreChartProps { score: number; enhanced?: boolean; size?: number; } export default function ScoreChart({ score, enhanced = false, size = 200 }: ScoreChartProps) { const [animatedScore, setAnimatedScore] = useState(0); const radius = size / 2 - 20; const circumference = 2 * Math.PI * radius; useEffect(() => { const timer = setTimeout(() => { setAnimatedScore(score); }, 300); return () => clearTimeout(timer); }, [score]); // Calculate stroke dash offset for the progress const strokeDashoffset = circumference - (animatedScore / 100) * circumference; // Determine color based on score const getColor = () => { if (score >= 80) return "#FF4A00"; // heat-200 - Excellent if (score >= 60) return "#FF6500"; // heat-150 - Good if (score >= 40) return "#FF8533"; // heat-100 - Warning return "#FFA566"; // heat-50 - Poor }; const getGradientId = enhanced ? "enhanced-gradient" : "normal-gradient"; return (