FutureCloud/app/[lang]/layout.tsx

34 lines
822 B
TypeScript
Raw Normal View History

2025-09-15 16:58:31 +08:00
import { ReactNode } from 'react';
import { Metadata } from 'next';
import { content } from '../../lib/content';
interface LanguageLayoutProps {
children: ReactNode;
params: {
lang: string;
};
}
export async function generateMetadata({
params,
}: {
params: { lang: string };
}): Promise<Metadata> {
const lang = params.lang as keyof typeof content;
const currentContent = content[lang] || content['zh-CN'];
return {
title: currentContent.title,
description: currentContent.description,
keywords: currentContent.keywords,
};
}
export default function LanguageLayout({ children, params }: LanguageLayoutProps) {
return children;
}
export async function generateStaticParams() {
return [{ lang: 'zh-CN' }, { lang: 'zh-TW' }, { lang: 'en' }];
}