'use client'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { ArrowLeft, Calendar, Share2 } from 'lucide-react'; import Link from 'next/link'; import { motion } from 'framer-motion'; import { useInView } from 'framer-motion'; import { useRef } from 'react'; import { NEWS } from '@/lib/constants'; interface NewsItem { id: string; title: string; category: string; date: string; excerpt: string; content: string; } interface NewsDetailClientProps { news: NewsItem; } export function NewsDetailClient({ news }: NewsDetailClientProps) { const contentRef = useRef(null); const isContentInView = useInView(contentRef, { once: true, margin: '-100px' }); const relatedNews = NEWS .filter((n) => n.id !== news.id && n.category === news.category) .slice(0, 3); return (
返回新闻列表
{news.category}

{news.title}

{news.date}
📰

{news.excerpt}

{news.content}
{relatedNews.length > 0 && (

相关新闻

{relatedNews.map((related) => (
📰
{related.category}

{related.title}

{related.excerpt}

))}
)}
); }