import { useState } from 'react' import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter' import { atomDark } from 'react-syntax-highlighter/dist/cjs/styles/prism' import Modal from 'react-modal' const CodeEditor = ({ language }) => { const [code, setCode] = useState('// کد خود را اینجا بنویسید\nconsole.log("سلام دنیا")') const [output, setOutput] = useState('') const [isModalOpen, setIsModalOpen] = useState(false) const [projectType, setProjectType] = useState('nodejs') const runCode = () => { try { const result = eval(code) setOutput(JSON.stringify(result, null, 2)) } catch (error) { setOutput(`خطا: ${error.message}`) } } const generateProject = () => { setIsModalOpen(true) } return (

{language === 'fa' ? 'ویرایشگر کد هوشمند' : 'Smart Code Editor'}

{code}