import Editor from '@monaco-editor/react';
import { useState } from 'react';

export const AppEditor = () => {
  const [code, setCode] = useState('');
  const [language, setLanguage] = useState('javascript');
  return (
    <div className='w-full h-full'>
      <Editor
        height={'100%'}
        value={code}
        language={language}
        onChange={(value) => {
          setCode(value || '');
        }}
        options={{
          minimap: { enabled: false },
        }}
        defaultLanguage='javascript'
        defaultValue='// some comment'
      />
    </div>
  );
};

export default AppEditor;
