Spaces:
Build error
Build error
| import { useState, useEffect } from 'react' | |
| import Head from 'next/head' | |
| import { FaCode, FaRobot, FaMicrophone, FaLanguage } from 'react-icons/fa' | |
| import CodeEditor from '../components/CodeEditor' | |
| import ChatInterface from '../components/ChatInterface' | |
| import VoiceControl from '../components/VoiceControl' | |
| import AgentWorkflow from '../components/AgentWorkflow' | |
| export default function Home() { | |
| const [activeTab, setActiveTab] = useState('chat') | |
| const [language, setLanguage] = useState('fa') | |
| return ( | |
| <div className="min-h-screen bg-gray-100"> | |
| <Head> | |
| <title>GhadirSync-AI | برنامهنویسی هوشمند</title> | |
| <meta name="description" content="دستیار هوشمند برنامهنویسی با قابلیتهای پیشرفته" /> | |
| </Head> | |
| <header className="bg-blue-600 text-white p-4 shadow-md"> | |
| <div className="container mx-auto flex justify-between items-center"> | |
| <h1 className="text-2xl font-bold">GhadirSync-AI</h1> | |
| <div className="flex items-center space-x-4"> | |
| <button | |
| onClick={() => setLanguage(language === 'fa' ? 'en' : 'fa')} | |
| className="flex items-center px-3 py-1 rounded bg-blue-700 hover:bg-blue-800" | |
| > | |
| <FaLanguage className="ml-1" /> | |
| {language === 'fa' ? 'English' : 'فارسی'} | |
| </button> | |
| <a | |
| href="https://huggingface.co/spaces/akhaliq/anycoder" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| className="text-sm hover:underline" | |
| > | |
| Built with anycoder | |
| </a> | |
| </div> | |
| </div> | |
| </header> | |
| <main className="container mx-auto p-4"> | |
| <div className="flex mb-4 border-b border-gray-300"> | |
| <button | |
| className={`px-4 py-2 font-medium ${activeTab === 'chat' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-600'}`} | |
| onClick={() => setActiveTab('chat')} | |
| > | |
| <FaRobot className="inline ml-1" /> | |
| {language === 'fa' ? 'چت هوشمند' : 'AI Chat'} | |
| </button> | |
| <button | |
| className={`px-4 py-2 font-medium ${activeTab === 'code' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-600'}`} | |
| onClick={() => setActiveTab('code')} | |
| > | |
| <FaCode className="inline ml-1" /> | |
| {language === 'fa' ? 'ویرایشگر کد' : 'Code Editor'} | |
| </button> | |
| <button | |
| className={`px-4 py-2 font-medium ${activeTab === 'agent' ? 'text-blue-600 border-b-2 border-blue-600' : 'text-gray-600'}`} | |
| onClick={() => setActiveTab('agent')} | |
| > | |
| <FaMicrophone className="inline ml-1" /> | |
| {language === 'fa' ? 'عامل هوشمند' : 'AI Agent'} | |
| </button> | |
| </div> | |
| {activeTab === 'chat' && <ChatInterface language={language} />} | |
| {activeTab === 'code' && <CodeEditor language={language} />} | |
| {activeTab === 'agent' && <AgentWorkflow language={language} />} | |
| </main> | |
| </div> | |
| ) | |
| } |