Created
November 26, 2023 02:23
-
-
Save FrancisGregori/edd5deee52e1a1c539c7b94f0db6fe89 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