summaryrefslogtreecommitdiffstats
path: root/src/components/FooterNav/FooterNav.tsx
blob: f1fd0b7405db33b5ca90faf8f5805be87fa9da32 (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
37
38
39
40
41
42
43
44
45
import Link from 'next/link';
import styles from './FooterNav.module.scss';
import { NavItem } from '@ts/types/nav';
import { useIntl } from 'react-intl';

const FooterNav = () => {
  const intl = useIntl();

  const footerNavConfig: NavItem[] = [
    {
      id: 'legal-notice',
      name: intl.formatMessage({
        defaultMessage: 'Legal notice',
        description: 'FooterNav: legal notice link',
      }),
      slug: '/mentions-legales',
    },
  ];

  const navItems = footerNavConfig.map((item) => {
    return (
      <li key={item.id} className={styles.item}>
        <Link href={item.slug}>
          <a className={styles.link}>{item.name}</a>
        </Link>
      </li>
    );
  });

  return (
    <div className={styles.wrapper}>
      <nav
        className={styles.nav}
        aria-label={intl.formatMessage({
          defaultMessage: 'Footer',
          description: 'FooterNav: aria-label',
        })}
      >
        <ul className={styles.list}>{navItems}</ul>
      </nav>
    </div>
  );
};

export default FooterNav;