Files
bewell-in-ua/app/[locale]/layout.tsx
2025-02-05 08:01:14 +02:00

34 lines
717 B
TypeScript

import {NextIntlClientProvider} from 'next-intl'
import {getMessages} from 'next-intl/server'
import {notFound} from 'next/navigation'
import {ReactNode} from 'react'
import {routing} from '@/i18n/routing'
import {TIMEZONE} from '@/lib/constants'
export default async function RootLayout({
children,
params
}: Readonly<{
children: ReactNode
params: Promise<{locale: string}>
}>) {
const {locale} = await params
if (!routing.locales.includes(locale as any)) {
notFound()
}
const messages = await getMessages()
//const queryClient = new QueryClient()
return (
<NextIntlClientProvider
messages={messages}
timeZone={TIMEZONE}
now={new Date()}
>
{children}
</NextIntlClientProvider>
)
}