'use client' import React, { useState, useEffect } from 'react' interface DynamicClockIconProps { size?: number | string className?: string } export function DynamicClockIcon({ size = '100%', className = '' }: DynamicClockIconProps) { const [time, setTime] = useState(null) useEffect(() => { setTime(new Date()) const timer = setInterval(() => { setTime(new Date()) }, 1000) return () => clearInterval(timer) }, []) if (!time) return null const seconds = time.getSeconds() const minutes = time.getMinutes() const hours = time.getHours() const secondDegrees = (seconds / 60) * 360 const minuteDegrees = ((minutes + seconds / 60) / 60) * 360 const hourDegrees = ((hours + minutes / 60) / 12) * 360 return (
{/* Hour Hand */}
{/* Minute Hand */}
{/* Second Hand */}
{/* Center Dot */}
) }