import React from 'react';
import AceEditor from "react-ace";

import "ace-builds/src-min-noconflict/mode-typescript";
import "ace-builds/src-min-noconflict/theme-xcode";

export interface EditorProps {
}

export interface EditorState {
}

/**
 * Uses: 
 * https://react-jsonschema-form.readthedocs.io/en/latest/
 */
class Editor extends React.Component<EditorProps, EditorState> {

    constructor(props) {
        super(props);
    }

    _dataUpdated(value: string, event){
        console.log(value)
    }


    public render() {
        return (
            <AceEditor
            mode="typescript"
            theme="xcode"
            onChange={this._dataUpdated}
            editorProps={{ $blockScrolling: true }}
          />
        );
    }
}

export default Editor;