21 lines
535 B
JavaScript
21 lines
535 B
JavaScript
'use client'
|
|
|
|
import { useCurrentLocale } from '@/locales/client'
|
|
import { LocaleProvider } from './LocaleProvider'
|
|
import ServerError from './error'
|
|
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
|
|
|
|
export default function LocaleLayout({ children }) {
|
|
const locale = useCurrentLocale()
|
|
|
|
return (
|
|
<>
|
|
<ErrorBoundary fallback={<ServerError />}>
|
|
<LocaleProvider locale={locale} fallback={<ServerError />}>
|
|
{children}
|
|
</LocaleProvider>
|
|
</ErrorBoundary>
|
|
</>
|
|
)
|
|
}
|