import { notFound } from "next/navigation"; import type { Metadata } from "next"; import { getSimpleContentPageBySlug } from "@/services/legal.service"; import { getPreviewOrFallback } from "@/services/preview.service"; import { createPageMetadata, getPageSEO } from "@/services/seo.service"; import PageSEO from "@/components/layout/PageSEO"; import type { SimpleContentPageDetail } from "@/types/wagtail"; export async function generateMetadata(): Promise { return createPageMetadata(await getPageSEO("core.SimpleContentPage", "about").catch(() => null), "关于我们"); } export default async function AboutPage() { const fallback = () => getSimpleContentPageBySlug("about").catch(() => null); const candidate = await getPreviewOrFallback("core.simplecontentpage", "body", fallback); const page = candidate?.meta.slug === "about" ? candidate : await fallback(); if (!page) notFound(); return (

{page.title}

); }