import { useEffect, useState } from 'react'; interface RadioNavProps { active: string; onNavigate: (id: string) => void; } const items = [ { id: 'dashboard', label: 'Dashboard', icon: ( ), }, { id: 'analyze', label: 'Analyze', icon: ( ), }, { id: 'pricing', label: 'Pricing', icon: ( ), }, { id: 'agents', label: 'Agents', icon: ( ), }, { id: 'settings', label: 'Settings', icon: ( <> ), }, ]; export default function RadioNav({ active, onNavigate }: RadioNavProps) { const [hovered, setHovered] = useState(null); // Sync radio inputs with active state useEffect(() => { const el = document.getElementById(active) as HTMLInputElement | null; if (el) el.checked = true; }, [active]); return (
{items.map(item => { const isActive = active === item.id; const isHovered = hovered === item.id; return ( ); })}
); }