import styles from './navbar.module.scss'; import { useRouter } from 'next/router'; export const Navbar = () => { return ( ); }; interface NavLinkProps { name: string; path: string; } const NavLink = ({ name, path }: NavLinkProps) => { const router = useRouter(); const color = router.asPath === path ? 'blue' : 'inherit'; return ( { e.preventDefault(); router.push(path); }} style={{ color }} > {name} ); };