import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Terminal, Cpu, Zap, Code, Server, ArrowRight, CheckCircle, Copy } from 'lucide-react'; import SharedHeader from '../components/SharedHeader'; import './step3.css'; import StepProgress from '../components/StepProgress'; import { useGlobalSettings } from '../hooks/useGlobalSettings'; import { useEmailSubmission } from '../hooks/useEmailSubmission'; const Step3 = () => { const { t } = useTranslation(); // 使用统一的全局状态管理 const { isDark, currentLang, toggleTheme, toggleLang } = useGlobalSettings(); const navigate = useNavigate(); // Code Snippet State const [copied, setCopied] = useState(false); const codeSnippet = `curl https://api.ccdw.xyz/v1/chat/completions \\ -H "Content-Type: application/json" \\ -H "Authorization: Bearer YOUR_API_KEY" \\ -d '{ "model": "gpt-4-turbo", "messages": [{"role": "user", "content": "Hello!"}] }'`; const handleCopy = () => { navigator.clipboard.writeText(codeSnippet); setCopied(true); setTimeout(() => setCopied(false), 2000); }; // Theme-based classes const theme = { bg: isDark ? 'bg-[#0a0a0a]' : 'bg-white', bgSecondary: isDark ? 'bg-[#111]' : 'bg-stone-50', bgTertiary: isDark ? 'bg-[#0d0d0d]' : 'bg-stone-100', text: isDark ? 'text-white' : 'text-stone-900', textMuted: isDark ? 'text-gray-400' : 'text-stone-600', textLight: isDark ? 'text-gray-600' : 'text-stone-400', border: isDark ? 'border-[#222]' : 'border-stone-200', borderLight: isDark ? 'border-[#333]' : 'border-stone-300', accent: 'text-[#00f0ff]', accentBg: isDark ? 'bg-[#00f0ff]/10' : 'bg-cyan-50', cardBg: isDark ? 'bg-[#111]' : 'bg-white', cardBorder: isDark ? 'border-[#333]' : 'border-stone-200', inputBg: isDark ? 'bg-[#1a1a1a]' : 'bg-white', codeHeaderBg: isDark ? 'bg-[#1a1a1a]' : 'bg-stone-100', selection: isDark ? 'selection:bg-[#00f0ff] selection:text-black' : 'selection:bg-cyan-200 selection:text-cyan-900', }; // Email Submission Logic - 使用统一的 hook const [email, setEmail] = useState(''); const { submitEmail, status, message } = useEmailSubmission(); const handleEmailSubmit = async () => { if (!email) return; const result = await submitEmail({ email, source: 'Step3_Developer' }); if (result.success) { setEmail(''); } }; return (
{/* Progress Indicator */}
{/* Hero Section */}
{/* Background Grid */}
{t('step3.label')}

{t('step3.hero_title')}
{t('step3.hero_title_highlight')}

{t('step3.hero_desc')} {t('step3.hero_desc_highlight')}
{t('step3.hero_subtitle')}

{/* Services Grid */}
{/* Token Relay */}

{t('step3.services.token.title')}

{t('step3.services.token.desc')}

{t('step3.services.token.highlight')}
{/* Elastic Compute */}

{t('step3.services.compute.title')}

{t('step3.services.compute.desc')}

{t('step3.services.compute.highlight')}
{/* SaaS Kit */}

{t('step3.services.saas.title')}

{t('step3.services.saas.desc')}

{t('step3.services.saas.highlight')}
{/* Code & Integration */}

{t('step3.code_title')}

{(t('step3.features', { returnObjects: true }) as any[]).map((feature: any, idx: number) => (

{feature.title}

{feature.desc}

))}
bash
                                    {codeSnippet}
                                
{/* CTA / Footer */}
); }; export default Step3;