aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/links/nav-link.tsx
blob: 25c0e7d4a971c493ba77bcb2c7bd11d0177d244c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Link from 'next/link';
import { VFC, ReactNode } from 'react';
import styles from './nav-link.module.scss';

export type NavLinkProps = {
  /**
   * Link target.
   */
  href: string;
  /**
   * Link label.
   */
  label: string;
  /**
   * Link logo.
   */
  logo?: ReactNode;
};

/**
 * NavLink component
 *
 * Render a navigation link.
 */
const NavLink: VFC<NavLinkProps> = ({ href, label, logo }) => {
  return (
    <Link href={href}>
      <a className={styles.link}>
        {logo}
        {label}
      </a>
    </Link>
  );
};

export default NavLink;