refactor: consolidate navigation links into reusable NavLinks component with dynamic styling

This commit is contained in:
2025-09-19 14:08:46 +02:00
parent ab14a5a8e5
commit 017fc41d2b
4 changed files with 9 additions and 17 deletions

View File

@@ -3,8 +3,9 @@
import { useRef, useState } from 'react'
import Link from 'next/link'
import { AnimatePresence, motion } from 'framer-motion'
import clsx from 'clsx'
export function NavLinks() {
export function NavLinks({ className }: { className?: string }) {
let [hoveredIndex, setHoveredIndex] = useState<number | null>(null)
let timeoutRef = useRef<number | null>(null)
@@ -31,7 +32,10 @@ export function NavLinks() {
<Link
key={label}
href={href}
className="relative -mx-3 -my-2 rounded-lg px-3 py-2 text-sm text-white transition-colors delay-150 hover:text-gray-300 hover:delay-0"
className={clsx(
'relative -mx-3 -my-2 rounded-lg px-3 py-2 text-sm text-white transition-colors delay-150 hover:text-gray-300 hover:delay-0',
className,
)}
onClick={(e) => handleClick(e, href)}
onMouseEnter={() => {
if (timeoutRef.current) {