import React from 'react';
import dynamic from 'next/dynamic'


const TextEditor = dynamic(async () => {
    // Manually Import the Editor.
    const ace = await import('react-ace');

    // Import the Editor Component
    return import('../../resources/ui/editor');
}, {
    // Prevent Rendering on the Server:
    ssr: false
});

const _TextEditor = dynamic(


    import('../..//resources/ui/editor'), {
    ssr: false
})

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

    constructor(props) {
        super(props);
    }

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


    public render() {
        return (
            <div>
                <TextEditor />
            </div>
        )
    }
}

export default Editor;