{article.metadata.title}
{article.metadata.description}
import Image from 'next/image'; import Link from 'next/link'; import { Article } from '@/lib/types'; import { formatDate } from '@/lib/utils'; import { Card, CardContent } from '@/app/components/ui/card'; import { Badge } from '@/app/components/ui/badge'; import { Share2, ArrowLeft, Calendar, User, Tag, Clock, Eye } from 'lucide-react'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import rehypeRaw from 'rehype-raw'; import rehypeSanitize from 'rehype-sanitize'; import ServerHeader from '@/app/components/ServerHeader'; import Footer from '@/app/components/Footer'; import { newsDetailTranslations } from '@/translations/news-detail'; import ShareButton from './ShareButton'; import BackButton from './BackButton'; interface NewsArticleServerComponentProps { article: Article; relatedArticles: Article[]; locale: string; } export default function NewsArticleServerComponent({ article, relatedArticles, locale }: NewsArticleServerComponentProps) { // 获取当前语言的翻译 const currentTranslations = newsDetailTranslations[locale as keyof typeof newsDetailTranslations] || newsDetailTranslations['zh-CN']; // 估算阅读时间 const estimateReadingTime = (content: string) => { const wordsPerMinute = 200; const words = content.split(/\s+/).length; return Math.ceil(words / wordsPerMinute); }; const readingTime = estimateReadingTime(article.content); return (
{article.metadata.description}
{currentTranslations.relatedArticlesSubtitle}
{relatedArticle.metadata.excerpt}