import React, { ChangeEvent } from "react"; import BaseControl, { ControlProps } from "./BaseControl"; import CodeEditor from "components/editorComponents/CodeEditor"; import { EventOrValueHandler } from "redux-form"; import { EditorModes, EditorSize, TabBehaviour, } from "components/editorComponents/CodeEditor/EditorConfig"; class CodeEditorControl extends BaseControl { render() { const { dataTreePath, evaluatedValue, expected, propertyValue, useValidationMessage, } = this.props; const props: Partial = {}; if (dataTreePath) props.dataTreePath = dataTreePath; if (evaluatedValue) props.evaluatedValue = evaluatedValue; if (expected) props.expected = expected; return ( ); } onChange: EventOrValueHandler> = ( value: string | ChangeEvent, ) => { this.updateProperty(this.props.propertyName, value, true); }; static getControlType() { return "CODE_EDITOR"; } } export default CodeEditorControl;