📝 priettier check
All checks were successful
PR Checks / lint-and-build (pull_request) Successful in 18s
All checks were successful
PR Checks / lint-and-build (pull_request) Successful in 18s
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
import {notFound} from 'next/navigation'
|
||||
import {setRequestLocale} from 'next-intl/server'
|
||||
import {routing} from '@/src/i18n/routing'
|
||||
import {ReactNode} from 'react'
|
||||
import { notFound } from 'next/navigation'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
import { routing } from '@/src/i18n/routing'
|
||||
import { ReactNode } from 'react'
|
||||
|
||||
type Props = {
|
||||
children: ReactNode
|
||||
breadcrumbs: ReactNode
|
||||
params: Promise<{locale: string}>
|
||||
params: Promise<{ locale: string }>
|
||||
}
|
||||
|
||||
export function generateStaticParams() {
|
||||
return routing.locales.map((locale) => ({locale}))
|
||||
return routing.locales.map(locale => ({ locale }))
|
||||
}
|
||||
|
||||
export default async function LocaleLayout({
|
||||
children,
|
||||
breadcrumbs,
|
||||
params
|
||||
}: Props) {
|
||||
const {locale} = await params
|
||||
|
||||
export default async function LocaleLayout({ children, breadcrumbs, params }: Props) {
|
||||
const { locale } = await params
|
||||
|
||||
if (!routing.locales.includes(locale as any)) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user