{news.excerpt}
import { notFound } from 'next/navigation'; import { NEWS } from '@/lib/constants'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { ArrowLeft, Calendar, Share2 } from 'lucide-react'; import Link from 'next/link'; export async function generateStaticParams() { return NEWS.map((news) => ({ id: news.id, })); } export async function generateMetadata({ params }: { params: { id: string } }) { const news = NEWS.find((n) => n.id === params.id); if (!news) { return { title: '新闻未找到', }; } return { title: `${news.title} - 睿新致远`, description: news.excerpt, }; } export default function NewsDetailPage({ params }: { params: { id: string } }) { const news = NEWS.find((n) => n.id === params.id); if (!news) { notFound(); } const relatedNews = NEWS .filter((n) => n.id !== news.id && n.category === news.category) .slice(0, 3); return (
{news.excerpt}
{related.excerpt}