import { ReactElement, ReactNode, useEffect, useRef } from 'react'; import Footer from '@components/Footer/Footer'; import Header from '@components/Header/Header'; import Main from '@components/Main/Main'; import Breadcrumb from '@components/Breadcrumb/Breadcrumb'; import { t } from '@lingui/macro'; import Head from 'next/head'; import { config } from '@config/website'; import { useRouter } from 'next/router'; import { WebSite, WithContext } from 'schema-dts'; const Layout = ({ children, isHome = false, }: { children: ReactNode; isHome?: boolean; }) => { const ref = useRef(null); const { asPath } = useRouter(); useEffect(() => { ref.current?.focus(); }, [asPath]); const schemaJsonLd: WithContext = { '@context': 'https://schema.org', '@id': `${config.url}`, '@type': 'WebSite', name: config.name, description: config.baseline, url: config.url, author: { '@id': `${config.url}/#branding` }, copyrightYear: Number(config.copyright.startYear), creator: { '@id': `${config.url}/#branding` }, editor: { '@id': `${config.url}/#branding` }, inLanguage: config.locales.defaultLocale, potentialAction: { '@type': 'SearchAction', target: `${config.url}/recherche?s={query}`, query: 'required', }, }; return ( <> {t`Skip to content`}
{children}