import { useState } from "react"; import MonacoEditor, { OnChange } from "@monaco-editor/react"; interface EditorProps { height?: string; width?: string; theme?: string; language?: string; onChange?: OnChange; } const Editor = (props: EditorProps) => { const [code, setCode] = useState('console.log("Hello, Monaco!");'); const handleEditorChange: OnChange = (value) => { setCode(value || ""); }; const { height = "90vh", width = "100%", theme = "vs-dark", language = "typescript", onChange = handleEditorChange, } = props; return ( ); }; export default Editor;