NavLink.tsx 303 B

12345678910111213141516
  1. import Link from '@/components/Link';
  2. import clsx from 'clsx';
  3. function NavLink({ href, active, children, ...props }) {
  4. if (active) {
  5. props.className = clsx(props.className, 'active');
  6. }
  7. return (
  8. <Link href={href} {...props}>
  9. {children}
  10. </Link>
  11. );
  12. }
  13. export default NavLink;