24 lines
522 B
TypeScript
24 lines
522 B
TypeScript
import type { ReactNode } from 'react';
|
|
import { RootProvider } from 'fumadocs-ui/provider/next';
|
|
import { i18nUI } from '@/lib/i18n';
|
|
|
|
export default async function LangLayout({
|
|
params,
|
|
children,
|
|
}: {
|
|
params: Promise<{ lang: string }>;
|
|
children: ReactNode;
|
|
}) {
|
|
const { lang } = await params;
|
|
|
|
return (
|
|
<RootProvider i18n={i18nUI.provider(lang)} theme={{ enabled: false }}>
|
|
{children}
|
|
</RootProvider>
|
|
);
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return [{ lang: 'en' }, { lang: 'cn' }];
|
|
}
|