'use client'; import { useState, useEffect } from 'react'; import { useTDK } from '../../../lib/useTDK'; import { useRouter, usePathname } from 'next/navigation'; import Navigation from '../../../components/Navigation'; import Footer from '../../../components/Footer'; import BackgroundElements from '../../../components/BackgroundElements'; interface PageProps { params: { locale: string }; } export default function ContactPage({ params }: PageProps) { const [currentLang, setCurrentLang] = useState(params.locale); const [isLoaded, setIsLoaded] = useState(false); const [formData, setFormData] = useState({ name: '', email: '', subject: '', message: '', }); const router = useRouter(); const pathname = usePathname(); // Update TDK when language changes useTDK(currentLang, 'contact'); const translations = { 'zh-CN': { nav: { home: '首页', products: '产品', pricing: '价格', support: '支持', contact: '联系我们', }, contact: { title: '联系我们', subtitle: '随时与我们取得联系', description: '有任何问题或建议?我们很乐意听到您的声音', form: { name: '姓名', email: '邮箱', subject: '主题', message: '消息', send: '发送消息', namePlaceholder: '请输入您的姓名', emailPlaceholder: '请输入您的邮箱', subjectPlaceholder: '请输入主题', messagePlaceholder: '请输入您的消息...', }, info: { title: '联系信息', address: '地址', phone: '电话', email: '邮箱', hours: '工作时间', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 版权所有.`, }, }, 'zh-TW': { nav: { home: '首頁', products: '產品', pricing: '價格', support: '支援', contact: '聯絡我們', }, contact: { title: '聯絡我們', subtitle: '隨時與我們取得聯絡', description: '有任何問題或建議?我們很樂意聽到您的聲音', form: { name: '姓名', email: '郵箱', subject: '主題', message: '訊息', send: '發送訊息', namePlaceholder: '請輸入您的姓名', emailPlaceholder: '請輸入您的郵箱', subjectPlaceholder: '請輸入主題', messagePlaceholder: '請輸入您的訊息...', }, info: { title: '聯絡資訊', address: '地址', phone: '電話', email: '郵箱', hours: '工作時間', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 版權所有.`, }, }, en: { nav: { home: 'Home', products: 'Products', pricing: 'Pricing', support: 'Support', contact: 'Contact', }, contact: { title: 'Contact Us', subtitle: 'Get in touch with us', description: "Have any questions or suggestions? We'd love to hear from you", form: { name: 'Name', email: 'Email', subject: 'Subject', message: 'Message', send: 'Send Message', namePlaceholder: 'Enter your name', emailPlaceholder: 'Enter your email', subjectPlaceholder: 'Enter subject', messagePlaceholder: 'Enter your message...', }, info: { title: 'Contact Information', address: 'Address', phone: 'Phone', email: 'Email', hours: 'Business Hours', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. All rights reserved.`, }, }, ko: { nav: { home: '홈', products: '제품', pricing: '가격', support: '지원', contact: '연락처', }, contact: { title: '연락처', subtitle: '언제든지 연락하세요', description: '질문이나 제안이 있으신가요? 여러분의 의견을 듣고 싶습니다', form: { name: '이름', email: '이메일', subject: '제목', message: '메시지', send: '메시지 보내기', namePlaceholder: '이름을 입력하세요', emailPlaceholder: '이메일을 입력하세요', subjectPlaceholder: '제목을 입력하세요', messagePlaceholder: '메시지를 입력하세요...', }, info: { title: '연락처 정보', address: '주소', phone: '전화', email: '이메일', hours: '영업시간', }, }, footer: { copyright: `© ${new Date().getFullYear()} CloudProxy. 모든 권리 보유.`, }, }, ja: { nav: { home: 'ホーム', products: '製品', pricing: '価格', support: 'サポート', contact: 'お問い合わせ', }, contact: { title: 'お問い合わせ', subtitle: 'いつでもご連絡ください', description: 'ご質問やご提案はありませんか?ぜひお聞かせください', form: { name: '名前', email: 'メール', subject: '件名', message: 'メッセージ', send: 'メッセージを送信', namePlaceholder: 'お名前を入力してください', emailPlaceholder: 'メールアドレスを入力してください', subjectPlaceholder: '件名を入力してください', messagePlaceholder: 'メッセージを入力してください...', }, info: { title: '連絡先情報', address: '住所', phone: '電話', email: 'メール', hours: '営業時間', }, }, 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 handleInputChange = (e: React.ChangeEvent) => { setFormData({ ...formData, [e.target.name]: e.target.value, }); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // Handle form submission here console.log('Form submitted:', formData); }; return (
{/* Header */}

{t.contact.title}

{t.contact.subtitle}

{t.contact.description}

{/* Contact Form */}
{/* Contact Information */}

{t.contact.info.title}

{[ { title: t.contact.info.address, icon: ( ), content: '123 Cloud Street, Tech City, TC 12345', }, { title: t.contact.info.phone, icon: ( ), content: '+1 (555) 123-4567', }, { title: t.contact.info.email, icon: ( ), content: 'contact@cloudproxy.com', }, { title: t.contact.info.hours, icon: ( ), content: 'Mon - Fri: 9:00 AM - 6:00 PM', }, ].map((info, index) => (
{info.icon}

{info.title}

{info.content}

))}
); }