1→import dynamic from 'next/dynamic'; 2→ 3→const HomeClient = dynamic(() => import('./home-client'), { ssr: false }); 4→ 5→export default function Home() { 6→ return ; 7→} 8→ 9→const STYLES = [ 10→ { id: 'cinematic', label: 'سينمائي', icon: '🎬', desc: 'جودة سينمائية عالية' }, 11→ { id: 'anime', label: 'أنمي', icon: '🎨', desc: 'رسوم أنمي يابانية' }, 12→ { id: 'realistic', label: 'واقعي', icon: '📷', desc: 'تصوير واقعي' }, 13→ { id: 'fantasy', label: 'خيالي', icon: '🧙', desc: 'عوالم خيالية' }, 14→ { id: 'documentary', label: 'وثائقي', icon: '📹', desc: 'أسلوب وثائقي' }, 15→ { id: 'watercolor', label: 'مائي', icon: '🖌️', desc: 'رسم مائي فني' }, 16→]; 17→ 18→const EXAMPLE_PROMPTS = [ 19→ 'رحلة عبر الغابات المطيرة الاستوائية مع أصوات الطيور والشلالات', 20→ 'مدينة مستقبلية في عام 2150 مع السيارات الطائرة والأبنية الشفافة', 21→ 'قصة فتاة صغيرة تكتشف عالماً سحرياً خلف خزانة قديمة', 22→ 'غروب الشمس على شاطئ هادئ مع الأمواج والنورس الأبيض', 23→]; 24→ 25→export default function Home() { 26→ return ( 27→
28→
29→
30→ 31→
32→
33→
34→ ); 35→} 36→ 37→/* ───────────────────── Header ───────────────────── */ 38→function Header() { 39→ const { activeView, setActiveView, projects } = useVideoStore(); 40→ 41→ return ( 42→
43→
44→ 56→ 57→ 82→
83→
84→ ); 85→} 86→ 87→/* ───────────────────── App Content Router ───────────────────── */ 88→function AppContent() { 89→ const { activeView, isGenerating } = useVideoStore(); 90→ 91→ return ( 92→ 93→ {isGenerating ? ( 94→ 101→ 102→ 103→ ) : activeView === 'player' ? ( 104→ 111→ 112→ 113→ ) : activeView === 'gallery' ? ( 114→ 121→ 122→ 123→ ) : ( 124→ 130→ 131→ 132→ )} 133→ 134→ ); 135→} 136→ 137→/* ───────────────────── Create Section ───────────────────── */ 138→function CreateSection() { 139→ const { prompt, setPrompt, selectedStyle, setSelectedStyle, sceneCount, setSceneCount, isGenerating, setIsGenerating, setGenerationProgress, setActiveView, setCurrentProject, addProject, projects, setProjects } = useVideoStore(); 140→ 141→ const handleGenerate = useCallback(async () => { 142→ if (!prompt.trim()) { 143→ toast.error('يرجى كتابة وصف للفيديو'); 144→ return; 145→ } 146→ 147→ setIsGenerating(true); 148→ setGenerationProgress({ step: 'جاري تحليل الوصف وإنشاء المشاهد...', progress: 10 }); 149→ 150→ try { 151→ const res = await fetch('/api/generate-video', { 152→ method: 'POST', 153→ headers: { 'Content-Type': 'application/json' }, 154→ body: JSON.stringify({ prompt: prompt.trim(), style: selectedStyle, sceneCount }), 155→ }); 156→ 157→ if (!res.ok) { 158→ const err = await res.json(); 159→ throw new Error(err.error || 'حدث خطأ أثناء التوليد'); 160→ } 161→ 162→ const project = await res.json(); 163→ addProject(project); 164→ setCurrentProject(project); 165→ setActiveView('player'); 166→ toast.success('تم إنشاء الفيديو بنجاح!'); 167→ } catch (err: any) { 168→ toast.error(err.message || 'حدث خطأ غير متوقع'); 169→ // Fetch updated project list 170→ try { 171→ const listRes = await fetch('/api/videos'); 172→ if (listRes.ok) { 173→ const data = await listRes.json(); 174→ setProjects(data.projects || []); 175→ } 176→ } catch { /* ignore */ } 177→ } finally { 178→ setIsGenerating(false); 179→ } 180→ }, [prompt, selectedStyle, sceneCount]); 181→ 182→ const handleExampleClick = (example: string) => { 183→ setPrompt(example); 184→ }; 185→ 186→ return ( 187→
188→ {/* Hero background */} 189→
190→ 191→
192→
193→ 194→
195→ {/* Hero Text */} 196→ 202→ 208→ 209→ مدعوم بالذكاء الاصطناعي المتقدم 210→ 211→

212→ حوّل أفكارك إلى{' '} 213→ فيديوهات مذهلة 214→

215→

216→ اكتب وصفاً لما تريده وسيقوم الذكاء الاصطناعي بإنشاء مشاهد وصور وسرد صوتي تلقائياً 217→

218→
219→ 220→ {/* Main Creation Card */} 221→ 226→ 227→ 228→ {/* Prompt Input */} 229→
230→ 234→