import React from "react" import PropTypes from "prop-types" export default class EditorContainer extends React.Component { // This is already debounced by editor.jsx onChange = (value) => { this.props.onChange(value) } render() { let { specSelectors, getComponent, errSelectors, fn, editorSelectors, configsSelectors } = this.props let Editor = getComponent("Editor") let wrapperClasses = ["editor-wrapper"] const readOnly = !!configsSelectors.get("readOnly") if(readOnly) { wrapperClasses.push("read-only") } let propsForEditor = this.props const editorOptions = { enableLiveAutocompletion: configsSelectors.get("editorLiveAutocomplete"), readOnly: readOnly, highlightActiveLine: !readOnly, highlightGutterLine: !readOnly, } return (
{ readOnly ?

Read Only

: null }
) } } EditorContainer.defaultProps = { onChange: Function.prototype } EditorContainer.propTypes = { specActions: PropTypes.object.isRequired, configsSelectors: PropTypes.object.isRequired, onChange: PropTypes.func, fn: PropTypes.object, specSelectors: PropTypes.object.isRequired, errSelectors: PropTypes.object.isRequired, editorSelectors: PropTypes.object.isRequired, getComponent: PropTypes.func.isRequired, }