'use client';
import { useState, useEffect } from 'react';
import { getTranslations, type Language } from '@/lib/languages';
export default function DatacenterPageClient({ params }: { params: { lang: string } }) {
const [isLoaded, setIsLoaded] = useState(false);
const [selectedRegion, setSelectedRegion] = useState('asia');
const lang = params.lang as Language;
const t = getTranslations(lang);
useEffect(() => {
setIsLoaded(true);
}, []);
const regions = [
{
key: 'asia',
icon: '🌏',
color: 'from-blue-500 to-cyan-500',
data: t.pages.datacenter.locations.asia,
},
{
key: 'america',
icon: '🌎',
color: 'from-green-500 to-teal-500',
data: t.pages.datacenter.locations.america,
},
{
key: 'europe',
icon: '🌍',
color: 'from-purple-500 to-pink-500',
data: t.pages.datacenter.locations.europe,
},
];
return (
{/* Header */}
{t.pages.datacenter.title}
{t.pages.datacenter.subtitle}
{t.pages.datacenter.description}
{/* Global Map Visualization */}
全球数据中心分布
{regions.map((region) => (
))}
{/* Selected Region Details */}
{regions.map(
(region) =>
selectedRegion === region.key && (
{region.data.title}
{region.data.cities.map((city, index) => (
🏢
{city}
延迟: <10ms
带宽: 10Gbps
状态: 正常
))}
),
)}
{/* Infrastructure Stats */}
{[
{ label: '数据中心', value: '50+', icon: '🏢', color: 'text-blue-400' },
{ label: '服务器', value: '10,000+', icon: '💻', color: 'text-cyan-400' },
{
label: '网络容量',
value: '100Tbps',
icon: '🌐',
color: 'text-green-400',
},
{ label: '可用性', value: '99.99%', icon: '⚡', color: 'text-yellow-400' },
].map((stat, index) => (
{stat.icon}
{stat.value}
{stat.label}
))}
{/* Network Performance */}
网络性能监控
实时延迟
{[
{ region: '亚太地区', latency: '8ms', status: 'excellent' },
{ region: '美洲地区', latency: '12ms', status: 'good' },
{ region: '欧洲地区', latency: '15ms', status: 'good' },
].map((item, index) => (
))}
带宽使用率
{[
{ region: '亚太地区', usage: 75 },
{ region: '美洲地区', usage: 60 },
{ region: '欧洲地区', usage: 45 },
].map((item, index) => (
{item.region}
{item.usage}%
))}
);
}