init:初始化项目
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { notFound } from "next/navigation";
|
||||
import { SiteChrome } from "@/components/site-chrome";
|
||||
import { getDictionary, isLocale, type Locale } from "@/lib/site-content";
|
||||
|
||||
export default async function LocaleLayout({
|
||||
children,
|
||||
params,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ locale: string }>;
|
||||
}>) {
|
||||
const { locale } = await params;
|
||||
|
||||
if (!isLocale(locale)) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const dictionary = getDictionary(locale as Locale);
|
||||
|
||||
return (
|
||||
<SiteChrome dictionary={dictionary} locale={locale}>
|
||||
{children}
|
||||
</SiteChrome>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user