import { Link } from "@/i18n/navigation"; import { getTranslations } from "next-intl/server"; import { ArrowLeft, Compass } from "lucide-react"; import { Container, Section } from "@/components/ui/layout"; import { buttonClassName } from "@/components/ui/button-variants"; import { getAllPosts } from "@/lib/posts"; /** * 404 页面(语言段内)。 * * 位于 `app/[locale]/not-found.tsx`,因此能访问 next-intl 上下文并使用 * 站点的页头 / 页脚布局。同时列出最新文章作为"继续浏览"的出口, * 避免用户走进死胡同。 */ export default async function NotFound() { const t = await getTranslations("NotFound"); const posts = (await getAllPosts()).slice(0, 3); return (

{t("eyebrow")}

{t("title")}

{t("description")}

{posts.length > 0 ? (

也许你想看看这些

    {posts.map((post) => (
  • {post.title} {post.summary}
  • ))}
) : null}
); }