This commit is contained in:
2025-11-21 16:19:29 +08:00
12 changed files with 1337 additions and 17 deletions

View File

@@ -16,11 +16,12 @@ const options = {
},
};
async function getMDXContent(locale: string) {
async function getMDXContent(locale: string, section: string) {
const filePath = path.join(
process.cwd(),
"content",
"about",
section,
`${locale}.mdx`
);
try {
@@ -56,9 +57,18 @@ export async function generateMetadata({
});
}
export default async function AboutPage({ params }: { params: Params }) {
export default async function AboutPage({
params,
searchParams
}: {
params: Params;
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}) {
const { locale } = await params;
const content = await getMDXContent(locale);
const resolvedSearchParams = await searchParams;
const section = (resolvedSearchParams.section as string) || "company";
const content = await getMDXContent(locale, section);
return (
<article className="w-full md:w-3/5 px-2 md:px-12">
@@ -75,4 +85,4 @@ export async function generateStaticParams() {
return LOCALES.map((locale) => ({
locale,
}));
}
}