Created
November 25, 2023 23:26
-
-
Save FrancisGregori/23e70f510233776f50119425a73ad715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ReactNode } from 'react'; | |
import { Inter } from 'next/font/google'; | |
import { notFound } from 'next/navigation'; | |
import Providers from '@/app/providers'; | |
import Navbar from '@/components/Navbar'; | |
import { locales } from '@/navigation'; | |
const inter = Inter({ subsets: ['latin'] }); | |
export function generateStaticParams() { | |
return locales.map((locale) => ({ locale })); | |
} | |
export default function LocaleLayout({ | |
children, | |
params: { locale }, | |
}: { | |
children: ReactNode; | |
params: { locale: string }; | |
}) { | |
if (!locales.includes(locale as any)) notFound(); | |
return ( | |
<html lang={locale}> | |
<body className={inter.className}> | |
<Providers> | |
<Navbar locale={locale} /> | |
{children} | |
</Providers> | |
</body> | |
</html> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment