'use client'; import { useState, useEffect } from 'react'; import { useRouter, usePathname } from 'next/navigation'; import Navigation from '../../../components/Navigation'; import Footer from '../../../components/Footer'; import BackgroundElements from '../../../components/BackgroundElements'; import { useTDK } from '../../../lib/useTDK'; import { supportedLocales, pages } from '../../../lib/sitemap'; interface PageProps { params: { locale: string }; } export default function SitemapPage({ params }: PageProps) { const [currentLang, setCurrentLang] = useState(params.locale); const [isLoaded, setIsLoaded] = useState(false); const router = useRouter(); const pathname = usePathname(); // Update TDK when language changes useTDK(currentLang, 'sitemap'); const translations = { 'zh-CN': { nav: { home: '首页', products: '产品', pricing: '价格', support: '支持', contact: '联系我们', }, sitemap: { title: '网站地图', subtitle: '浏览我们的所有页面', description: '查找您需要的页面和内容', languages: '语言版本', pages: '页面', pageNames: { '': '首页', '/products': '产品', '/pricing': '价格', '/support': '支持', '/contact': '联系我们', }, languageNames: { 'zh-CN': '简体中文', 'zh-TW': '繁体中文', en: 'English', ko: '한국어', ja: '日本語', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 版权所有.`, }, }, 'zh-TW': { nav: { home: '首頁', products: '產品', pricing: '價格', support: '支援', contact: '聯絡我們', }, sitemap: { title: '網站地圖', subtitle: '瀏覽我們的所有頁面', description: '查找您需要的頁面和內容', languages: '語言版本', pages: '頁面', pageNames: { '': '首頁', '/products': '產品', '/pricing': '價格', '/support': '支援', '/contact': '聯絡我們', }, languageNames: { 'zh-CN': '簡體中文', 'zh-TW': '繁體中文', en: 'English', ko: '한국어', ja: '日本語', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 版權所有.`, }, }, en: { nav: { home: 'Home', products: 'Products', pricing: 'Pricing', support: 'Support', contact: 'Contact', }, sitemap: { title: 'Sitemap', subtitle: 'Browse all our pages', description: 'Find the pages and content you need', languages: 'Language Versions', pages: 'Pages', pageNames: { '': 'Home', '/products': 'Products', '/pricing': 'Pricing', '/support': 'Support', '/contact': 'Contact', }, languageNames: { 'zh-CN': '简体中文', 'zh-TW': '繁体中文', en: 'English', ko: '한국어', ja: '日本語', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. All rights reserved.`, }, }, ko: { nav: { home: '홈', products: '제품', pricing: '가격', support: '지원', contact: '연락처', }, sitemap: { title: '사이트맵', subtitle: '모든 페이지 둘러보기', description: '필요한 페이지와 콘텐츠를 찾아보세요', languages: '언어 버전', pages: '페이지', pageNames: { '': '홈', '/products': '제품', '/pricing': '가격', '/support': '지원', '/contact': '연락처', }, languageNames: { 'zh-CN': '简体中文', 'zh-TW': '繁体中文', en: 'English', ko: '한국어', ja: '日本語', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 모든 권리 보유.`, }, }, ja: { nav: { home: 'ホーム', products: '製品', pricing: '価格', support: 'サポート', contact: 'お問い合わせ', }, sitemap: { title: 'サイトマップ', subtitle: 'すべてのページを閲覧', description: '必要なページとコンテンツを見つけてください', languages: '言語バージョン', pages: 'ページ', pageNames: { '': 'ホーム', '/products': '製品', '/pricing': '価格', '/support': 'サポート', '/contact': 'お問い合わせ', }, languageNames: { 'zh-CN': '简体中文', 'zh-TW': '繁体中文', en: 'English', ko: '한국어', ja: '日本語', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 全著作権所有.`, }, }, }; const t = translations[currentLang as keyof typeof translations] || translations['zh-CN']; useEffect(() => { setIsLoaded(true); setCurrentLang(params.locale); }, [params.locale]); const handleLanguageChange = (newLang: string) => { const currentPath = pathname.replace(`/${currentLang}`, ''); router.push(`/${newLang}${currentPath}`); }; const handlePageClick = (locale: string, pagePath: string) => { router.push(`/${locale}${pagePath}`); }; return (
{/* Header */}

{t.sitemap.title}

{t.sitemap.subtitle}

{t.sitemap.description}

{/* Languages Section */}

{t.sitemap.languages}

{supportedLocales.map((locale) => (

{ t.sitemap.languageNames[ locale as keyof typeof t.sitemap.languageNames ] }

{pages.map((page) => ( ))}
))}
{/* Pages Section */}

{t.sitemap.pages}

{pages.map((page, index) => (

{ t.sitemap.pageNames[ page.path as keyof typeof t.sitemap.pageNames ] }

Priority: {page.priority} Update: {page.changeFrequency}
{supportedLocales.map((locale) => ( ))}
))}
{/* XML Sitemap Link */}

XML Sitemap

For search engines and automated tools

View XML Sitemap
); }