import { getTranslations, Locale, getNavigationPaths } from '@/lib/i18n'; import { generateMetadata as generateSEOMetadata } from '@/lib/seo'; import Layout from '@/components/Layout'; import Link from 'next/link'; interface NewsPageProps { params: { locale: Locale; }; } export async function generateStaticParams() { const locales = ['zh-CN', 'zh-TW', 'en']; return locales.map((locale) => ({ locale, })); } export async function generateMetadata({ params }: NewsPageProps) { return generateSEOMetadata(params.locale, 'news'); } export default async function NewsPage({ params }: NewsPageProps) { const { locale } = params; const [common, news] = await Promise.all([ getTranslations(locale, 'common'), getTranslations(locale, 'news'), ]); const navigationPaths = getNavigationPaths(locale); const navigation = [ { name: common.navigation.home, href: navigationPaths.find((p) => p.key === 'home')?.path || '/', }, { name: common.navigation.products, href: navigationPaths.find((p) => p.key === 'products')?.path || '/products', }, { name: common.navigation.news, href: navigationPaths.find((p) => p.key === 'news')?.path || '/news', }, { name: common.navigation.support, href: navigationPaths.find((p) => p.key === 'support')?.path || '/support', }, { name: common.navigation.about, href: navigationPaths.find((p) => p.key === 'about')?.path || '/about', }, ]; // Separate featured and regular articles const featuredArticles = news.articles.filter((article: any) => article.featured); const regularArticles = news.articles.filter((article: any) => !article.featured); return ( {/* Hero Section */}

{news.title}

{news.subtitle}

{/* Categories Filter */}
{news.categories.map((category: any) => ( ))}
{/* Featured Articles */} {featuredArticles.length > 0 && (

{locale === 'en' ? 'Featured Stories' : locale === 'zh-TW' ? '精選報導' : '精选报道'}

{featuredArticles.map((article: any, index: number) => (
{/* Article Image */}
{article.category}
{locale === 'en' ? 'Featured' : locale === 'zh-TW' ? '精選' : '精选'}
{article.date} {article.readTime}

{article.title}

{article.excerpt}

{news.readMore}
))}
)} {/* Regular Articles */}

{locale === 'en' ? 'Latest News' : locale === 'zh-TW' ? '最新消息' : '最新消息'}

{regularArticles.map((article: any, index: number) => (
{article.category} {article.date} {article.readTime}

{article.title}

{article.excerpt}

{news.readMore} {locale === 'en' ? 'By' : locale === 'zh-TW' ? '作者:' : '作者:'}{' '} {article.author}
))}
{/* Newsletter Subscription */}

{locale === 'en' ? 'Stay Updated' : locale === 'zh-TW' ? '保持更新' : '保持更新'}

{locale === 'en' ? 'Subscribe to our newsletter for the latest industry insights and company updates.' : locale === 'zh-TW' ? '訂閱我們的電子報,獲取最新的行業洞察和公司動態。' : '订阅我们的电子报,获取最新的行业洞察和公司动态。'}

); }