import { t } from '@lingui/macro'; import Link from 'next/link'; import { useRouter } from 'next/router'; import styles from './Breadcrumb.module.scss'; const Breadcrumb = ({ pageTitle }: { pageTitle: string }) => { const router = useRouter(); const isHome = router.pathname === '/'; const isBlog = router.pathname === '/blog'; const isArticle = router.pathname.includes('/article/'); const isThematic = router.pathname.includes('/thematique/'); const isSubject = router.pathname.includes('/sujet/'); const getItems = () => { return ( <>
  • {t`Home`}
  • {isBlog &&
  • {t`Blog`}
  • } {(isArticle || isThematic || isSubject) && ( <>
  • {t`Blog`}
  • {pageTitle}
  • )} {!isBlog && !isArticle && !isThematic && !isSubject && (
  • {pageTitle}
  • )} ); }; return ( <> {!isHome && ( )} ); }; export default Breadcrumb;