import { motion } from 'framer-motion' const RADIUS = 20 const CIRC = 2 * Math.PI * RADIUS /** * Circular countdown timer with color feedback. * Green > 30s, amber 10–30s, red ≤ 10s (pulses urgently). * * @example * */ export default function Timer({ timeLeft, totalTime }) { const minutes = Math.floor(timeLeft / 60) const seconds = timeLeft % 60 const fraction = totalTime > 0 ? timeLeft / totalTime : 1 const pct = Math.max(0, Math.min(1, fraction)) const offset = CIRC * (1 - pct) const color = timeLeft > 30 ? 'var(--success)' : timeLeft > 10 ? 'var(--accent)' : 'var(--destructive)' const urgent = timeLeft <= 10 && timeLeft > 0 return ( {String(minutes).padStart(2, '0')}:{String(seconds).padStart(2, '0')} ) }