'use client'; import { useState } from 'react'; import Navigation from '../../../components/Navigation'; import Footer from '../../../components/Footer'; import { useLanguage } from '../../../hooks/useLanguage'; import Link from 'next/link'; interface NewsPageProps { params: { lang: string; }; } export default function NewsPage({ params }: NewsPageProps) { const { currentLang, setCurrentLang, currentContent, createLocalizedPath } = useLanguage( params.lang, ); const [selectedCategory, setSelectedCategory] = useState('all'); const filteredArticles = selectedCategory === 'all' ? currentContent.news.articles : currentContent.news.articles.filter( (article) => article.category === selectedCategory, ); const getCategoryColor = (category: string) => { const colors: Record = { industry: 'bg-blue-500/20 text-blue-400 border-blue-500/30', technology: 'bg-green-500/20 text-green-400 border-green-500/30', company: 'bg-purple-500/20 text-purple-400 border-purple-500/30', case: 'bg-orange-500/20 text-orange-400 border-orange-500/30', }; return colors[category] ?? 'bg-gray-500/20 text-gray-400 border-gray-500/30'; }; return (
{/* Hero Section */}

{currentContent.news.title}

{currentContent.news.subtitle}

{/* Category Filter */}
{Object.entries(currentContent.news.categories).map(([key, label]) => ( ))}
{/* Articles Grid */}
{filteredArticles.map((article) => (
{/* Article Image */}
{currentContent.news.categories[article.category]}
{/* Article Content */}
{article.author} {article.date} {article.readTime}

{article.title}

{article.summary}

{/* Tags */}
{article.tags.map((tag, index) => ( #{tag} ))}
阅读更多
))}
{/* Load More Button */} {filteredArticles.length > 6 && (
)}
{/* Newsletter Subscription */}

订阅我们的资讯

第一时间获取云计算行业最新动态和技术资讯

); }