mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
14 lines
350 B
JavaScript
14 lines
350 B
JavaScript
import React from 'react';
|
|
import Link from 'next/link';
|
|
import { useRouter } from 'next/router';
|
|
|
|
export const NavLink = ({ href, children }) => {
|
|
const { asPath } = useRouter();
|
|
const ariaCurrent = href === asPath ? 'page' : undefined;
|
|
|
|
return (
|
|
<Link prefetch href={href} aria-current={ariaCurrent}>
|
|
{children}
|
|
</Link>
|
|
);
|
|
};
|