'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'], ].map(([label, href], index) => ( { if (timeoutRef.current) { window.clearTimeout(timeoutRef.current) } setHoveredIndex(index) }} onMouseLeave={() => { timeoutRef.current = window.setTimeout(() => { setHoveredIndex(null) }, 50) }} onClick={(e) => { e.preventDefault() const targetId = href.substring(2) const targetElement = document.getElementById(targetId) if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth' }) } }} > {hoveredIndex === index && ( )} {label} )) }