-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeEditor.jsx
More file actions
25 lines (23 loc) · 818 Bytes
/
Copy pathCodeEditor.jsx
File metadata and controls
25 lines (23 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import React from 'react';
import Editor from '@monaco-editor/react';
const CodeEditor = ({ code, setCode, language }) => {
return (
<div className="editor-container" style={{ height: '60vh', border: '1px solid #333', borderRadius: '4px' }}>
<Editor
height="100%"
defaultLanguage={language}
language={language}
value={code}
onChange={(value) => setCode(value || "")}
theme="vs-dark"
options={{
minimap: { enabled: false },
fontSize: 14,
scrollBeyondLastLine: false,
automaticLayout: true,
}}
/>
</div>
);
};
export default CodeEditor;