-
-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy pathlayout.tsx
43 lines (35 loc) · 1.03 KB
/
layout.tsx
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 {NextIntlClientProvider} from 'next-intl';
import {getLocale, getTranslations} from 'next-intl/server';
import {ReactNode} from 'react';
import {clsx} from 'clsx';
import {Inter} from 'next/font/google';
import {routing} from '@/i18n/routing';
import Navigation from '@/components/Navigation';
import '@/styles.css';
type Props = {
children: ReactNode;
};
const inter = Inter({subsets: ['latin']});
export function generateStaticParams() {
return routing.locales.map((locale) => ({locale}));
}
export const dynamicParams = false;
export async function generateMetadata() {
const t = await getTranslations('LocaleLayout');
return {
title: t('title')
};
}
export default async function LocaleLayout({children}: Props) {
const locale = await getLocale();
return (
<html className="h-full" lang={locale}>
<body className={clsx(inter.className, 'flex h-full flex-col')}>
<NextIntlClientProvider>
<Navigation />
{children}
</NextIntlClientProvider>
</body>
</html>
);
}