'use client' import { useRef, useState } from 'react' import Link from 'next/link' import { AnimatePresence, motion } from 'framer-motion' export function NavLinks() { let [hoveredIndex, setHoveredIndex] = useState(null) let timeoutRef = useRef(null) return [ ['About', '/#about'], ['Features', '/#features'], ['How it Works', '/#howitworks'], ['Coming Soon', '/#comingsoon'], ['FAQs', '/#faqs'], ['Docs', 'https://threefold.info/mycelium_network/docs/'], ].map(([label, href], index) => ( { if (timeoutRef.current) { window.clearTimeout(timeoutRef.current) } setHoveredIndex(index) }} onMouseLeave={() => { timeoutRef.current = window.setTimeout(() => { setHoveredIndex(null) }, 50) }} onClick={(e) => { if (href.startsWith('/#')) { e.preventDefault(); const targetId = href.substring(2); const targetElement = document.getElementById(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth' }); } } }} target={href.startsWith('http') ? '_blank' : undefined} rel={href.startsWith('http') ? 'noopener noreferrer' : undefined} > {hoveredIndex === index && ( )} {label} )) }