'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) const handleClick = (e: React.MouseEvent, href: string) => { if (href.startsWith('/#')) { e.preventDefault(); const targetId = href.substring(2); const targetElement = document.getElementById(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth', }); } } }; return [ ['About', '/#about'], ['Network', '/#network'], ['Deploy', '/#deploy'], ['LLMs', '/#llms'], ['Features', '/#features'], ['Get Started', '/#get-started'], ].map(([label, href], index) => ( handleClick(e, href)} onMouseEnter={() => { if (timeoutRef.current) { window.clearTimeout(timeoutRef.current) } setHoveredIndex(index) }} onMouseLeave={() => { timeoutRef.current = window.setTimeout(() => { setHoveredIndex(null) }, 200) }} > {hoveredIndex === index && ( )} {label} )) }