"use client"; import { usePathname } from 'next/navigation'; import Link from 'next/link'; export interface NavLinkProps { href: string; title: string; children: React.ReactNode; onClick?: () => void; // Include onClick as an optional prop target?: string; } const HeaderNavLink: React.FC = ({ href, title, children, onClick }) => { // Use the useRouter hook to get information about the current route const pathname = usePathname(); // Determine if the current tab is active const isActive = pathname === href; const handleClick = () => { if (onClick) { onClick(); // Call the onClick handler if provided } }; return ( {/* Add a class to highlight the active tab */}
{children}
); }; const FooterNavLink: React.FC = ({ href, title, children, onClick, target }) => { const handleClick = () => { if (onClick) { onClick(); // Call the onClick handler if provided } }; return ( {/* Add a class to highlight the active tab */}
{children}
); } export { HeaderNavLink, FooterNavLink }