import { useState } from 'react'; import { Info } from 'lucide-react'; import { IconButton } from '@/components/ui/icon-button'; import { cn } from '@/lib/utils'; import { clampScore, getScoreStrokeColor } from '@/lib/score-colors'; import { __, sprintf } from '../lib/i18n'; const scoreInfoIconButtonClass = 'h-auto w-auto min-h-0 min-w-0 border-0 bg-transparent p-0 shadow-none hover:bg-transparent'; interface ScoreGaugeProps { score: number; label?: string; size?: 'hero' | 'compact'; infoText?: string; className?: string; } export function ScoreGauge({ score, label, size = 'compact', infoText, className, }: ScoreGaugeProps) { const [showTooltip, setShowTooltip] = useState(false); const clamped = clampScore(score); const stroke = getScoreStrokeColor(clamped); const isHero = size === 'hero'; const svgSize = isHero ? 120 : 64; const radius = isHero ? 46 : 26; const strokeWidth = isHero ? 10 : 6; const circumference = 2 * Math.PI * radius; const filled = (clamped / 100) * circumference; const center = svgSize / 2; return (