59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Suspense } from "react";
|
|
|
|
import { PageLoading } from "@/components/common/page-loading";
|
|
import { JsonLd } from "@/components/seo/json-ld";
|
|
import { WelfarePage } from "@/components/welfare/welfare-page";
|
|
import { buildWelfareCategories, type WelfareCategory } from "@/components/welfare/data";
|
|
import { getAppListCached } from "@/lib/api/applist";
|
|
import { buildWebPageJSONLD, getHomeBaseSEOCached, resolvePageMetadata } from "@/lib/seo";
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
return resolvePageMetadata({
|
|
seoInfo: {
|
|
title: "福利应用",
|
|
description: "黄果黑料福利应用与精选推荐。",
|
|
keyworld: ["黄果黑料", "福利应用"],
|
|
},
|
|
canonical: "/welfare",
|
|
});
|
|
}
|
|
|
|
async function WelfareContent() {
|
|
let categories: WelfareCategory[] = [];
|
|
try {
|
|
const data = await getAppListCached(0);
|
|
categories = buildWelfareCategories(data);
|
|
} catch (error) {
|
|
console.error("[welfare]", error);
|
|
}
|
|
|
|
const siteSeo = await getHomeBaseSEOCached();
|
|
return (
|
|
<>
|
|
<JsonLd
|
|
data={buildWebPageJSONLD({
|
|
path: "/welfare",
|
|
title: "福利应用",
|
|
description: "黄果黑料福利应用与精选推荐。",
|
|
type: "CollectionPage",
|
|
breadcrumbs: [
|
|
["首页", "/"],
|
|
["福利应用", "/welfare"],
|
|
],
|
|
siteName: siteSeo.siteName,
|
|
})}
|
|
/>
|
|
<WelfarePage categories={categories} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Suspense fallback={<PageLoading />}>
|
|
<WelfareContent />
|
|
</Suspense>
|
|
);
|
|
}
|