import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { Sparkles, Cpu, Zap, CheckCircle2, Terminal, ArrowLeft, ShieldCheck, Layers, Copy, Check, RotateCcw, Flame, Brain, Code, Palette, TrendingUp } from 'lucide-react'; interface PromptPreset { id: string; category: string; icon: React.ReactNode; model: string; modelIcon: string; modelProvider: string; prompt: string; thought?: string; response: string; stats: { speed: string; tokens: string; latency: string; }; } export const HeroAiVisual: React.FC = () => { const presets: PromptPreset[] = [ { id: 'strategy', category: 'استراتژی کسب‌وکار', icon: , model: 'GPT-4o', modelIcon: '/storage/bot/llm/gpt.png', modelProvider: 'OpenAI', prompt: 'یک استراتژی عملیاتی ۳۰ روزه برای تحول دیجیتال و رشد ۳ برابری فروش تدوین کن.', thought: 'بررسی داده‌های بازار هدف، بهینه‌سازی قیف فروش و خودکارسازی فرآیند با هوش مصنوعی...', response: `۱. **هوشمندسازی قیف فروش**: پیاده‌سازی ربات هوشان برای پاسخ‌دهی خودکار و تبدیل ۲۴ ساعته لیدها. ۲. **شخصی‌سازی بازاریابی**: تولید کمپین‌های تبلیغاتی متناسب با رفتار مشتری با نرخ تبدیل +۴۵٪. ۳. **داشبورد تحلیلی پیش‌بین**: یکپارچه‌سازی تحلیل داده‌ها برای تصمیم‌گیری مدیران ارشد در لحظه.`, stats: { speed: '۲۸۰ توکن/ثانیه', tokens: '۵۴۰ توکن', latency: '۰.۲۴s' } }, { id: 'coding', category: 'برنامه‌نویسی و وب', icon: , model: 'Claude 3.7 Sonnet', modelIcon: '/storage/bot/llm/claude.png', modelProvider: 'Anthropic', prompt: 'یک تابع پایتون بنویس که اتصال پایگاه داده را با کش Redis و مدیریت خطای خودکار انجام دهد.', thought: 'تحلیل ساختار ناهمگام (Async)، مدیریت Connection Pool و کش دو لایه...', response: `\`\`\`python from fastapi import FastAPI, Depends import redis.asyncio as aioredis async def get_cached_ai_response(prompt_hash: str): client = aioredis.from_url("redis://localhost:6379") cached = await client.get(prompt_hash) if cached: return {"source": "cache", "data": cached.decode()} return None \`\`\``, stats: { speed: '۳۲۰ توکن/ثانیه', tokens: '۶۸۰ توکن', latency: '۰.۱۹s' } }, { id: 'reasoning', category: 'استدلال عمیق و منطق', icon: , model: 'DeepSeek R1', modelIcon: '/storage/bot/llm/deepseek.png', modelProvider: 'DeepSeek AI', prompt: 'روش بهینه‌سازی الگوریتم مسیریابی لجستیک با حداقل مصرف انرژی را گام به گام تحلیل کن.', thought: 'فرموله‌سازی مسئله TSP و الگوریتم ژنتیک ترکیبی با ضریب متغیر ترافیک...', response: `✓ **اثبات ریاضی بهینه‌سازی**: استفاده از گراف وزندار $G=(V, E)$ و حداقل‌سازی تابع هزینه: $$\\min \\sum_{i,j} c_{ij} x_{ij} + \\lambda \\cdot E(traffic)$$ نتیجه: کاهش ۲۳٪ در مصرف انرژی ناوگان و ۱۸٪ زمان سفر به دست می‌آید.`, stats: { speed: '۲۱۰ توکن/ثانیه', tokens: '۷۹۰ توکن', latency: '۰.۳۱s' } }, { id: 'design', category: 'ایده‌پردازی و تصویر', icon: , model: 'Gemini 2.0 Flash', modelIcon: '/storage/bot/llm/gemini.png', modelProvider: 'Google AI', prompt: 'یک توصیف پرامپت حرفه‌ای انگلیسی برای تولید لوگو و کاراکتر هوش مصنوعی مدرن بساز.', thought: 'ایجاد توصیف متنی سینمایی، نورپردازی نئونی و استایل سه بعدی هایپربولیک...', response: `"Cinematic 3D isometric render of an intelligent futuristic AI glowing core, translucent glassmorphism interface floating in deep navy space, glowing cyan and violet optic cables, 8k resolution, minimalist masterpiece."`, stats: { speed: '۳۶۰ توکن/ثانیه', tokens: '۳۱۰ توکن', latency: '۰.۱۵s' } } ]; const [viewMode, setViewMode] = useState<'statue' | 'sandbox'>('statue'); const [activeTab, setActiveTab] = useState('strategy'); const [copied, setCopied] = useState(false); const [displayText, setDisplayText] = useState(''); const [isTyping, setIsTyping] = useState(false); const currentPreset = presets.find((p) => p.id === activeTab) || presets[0]; useEffect(() => { setIsTyping(true); setDisplayText(''); let idx = 0; const fullText = currentPreset.response; const interval = setInterval(() => { idx += 3; if (idx >= fullText.length) { setDisplayText(fullText); setIsTyping(false); clearInterval(interval); } else { setDisplayText(fullText.slice(0, idx)); } }, 15); return () => clearInterval(interval); }, [activeTab]); const handleCopy = () => { navigator.clipboard.writeText(currentPreset.response); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return (
{/* Decorative Glow Orbs in Background */}
{/* Mode Switcher Pills (Statue Artwork vs Live Sandbox) */}
{viewMode === 'statue' ? ( /* Authentic Original Hero Artwork View */
{/* Halftone Aura Light */}
{/* Floating AI Feature Badges */}
🎬
تولید ویدیو متن و تصویر به ویدیو
🎨
استودیو تصویر کیفیت 4K و روتوش
🎙️
صوت و موسیقی تولید آهنگ و TTS
🧠
استدلال عمیق GPT-4o & DeepSeek R1
{/* Original Greek Statue AI Artwork */}
هوشان؛ دستیار هوش مصنوعی شما
{/* Bottom Quick Test Bar */}
پلتفرم یکپارچه هوش مصنوعی فارسی
) : ( /* Main Glassmorphic AI Console Window */
{/* Top Window Header Bar */}
{/* Window Buttons */}
Houshan AI Engine v2.0
{/* Active Model Indicator */}
{currentPreset.model} {currentPreset.model}
{/* Interactive Category Selector Tabs */}
{presets.map((preset) => { const isActive = activeTab === preset.id; return ( ); })}
{/* Playground Content Area */}
{/* User Prompt Message */}
شما

{currentPreset.prompt}

{/* AI Thinking Step (If reasoning model) */} {currentPreset.thought && (
فرایند تفکر عمیق: {currentPreset.thought}
)} {/* AI Response Box */}
{currentPreset.model} پاسخ هوش مصنوعی هوشان ({currentPreset.model})
{/* Generated Output with Formatting */}
{displayText} {isTyping && }
{/* Performance Stats Pill Bar */}
⚡ {currentPreset.stats.latency} 🚀 {currentPreset.stats.speed} 📝 {currentPreset.stats.tokens}
امتحان در محیط چت کامل
{/* Model Family Quick Carousel */}
{[ { name: 'GPT-4o', brand: 'OpenAI', icon: '/storage/bot/llm/gpt.png', badge: 'Flagship' }, { name: 'Claude 3.7', brand: 'Anthropic', icon: '/storage/bot/llm/claude.png', badge: 'Sonnet' }, { name: 'DeepSeek R1', brand: 'DeepSeek', icon: '/storage/bot/llm/deepseek.png', badge: 'Reasoning' }, { name: 'Gemini 2.0', brand: 'Google', icon: '/storage/bot/llm/gemini.png', badge: 'Flash' }, ].map((m, i) => (
{m.name}
{m.name} {m.badge}
))}
)}
); };