"use client"; import { motion } from "framer-motion"; interface CircularProgressProps { score: number; label: string; size?: number; strokeWidth?: number; } function getScoreColor(score: number): string { if (score >= 70) return "#0070f3"; if (score >= 40) return "#00d4ff"; return "#666"; } export default function CircularProgress({ score, label, size = 96, strokeWidth = 8, }: CircularProgressProps) { const radius = (size - strokeWidth * 2) / 2; const circumference = 2 * Math.PI * radius; const progress = (score / 100) * circumference; const color = getScoreColor(score); const cx = size / 2; const cy = size / 2; return (
{/* Background track */} {/* Progress arc */} {/* Center score */}
{score}
{label}
); }