import { useRef, useState } from 'react' import { Link } from 'react-router-dom' import { AnimatePresence, motion } from 'framer-motion' export function NavLinks() { let [hoveredIndex, setHoveredIndex] = useState(null) let timeoutRef = useRef(null) return [ ['Features', '/#features'], ['Reviews', '/#reviews'], ['Pricing', '/#pricing'], ['FAQs', '/#faqs'], ].map(([label, href], index) => ( { if (timeoutRef.current) { window.clearTimeout(timeoutRef.current) } setHoveredIndex(index) }} onMouseLeave={() => { timeoutRef.current = window.setTimeout(() => { setHoveredIndex(null) }, 200) }} > {hoveredIndex === index && ( )} {label} )) }