aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/FooterNav/FooterNav.tsx
blob: 7167b698a6e95997e23c0cb8666e92175ad1c9e4 (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
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 (
    <nav
      className={styles.nav}
      aria-label={intl.formatMessage({
        defaultMessage: 'Footer',
        description: 'FooterNav: aria-label',
      })}
    >
      <ul className={styles.list}>{navItems}</ul>
    </nav>
  );
};

export default FooterNav;