import React, { FC, HTMLAttributes } from 'react';
import 'brace';
import 'brace/mode/json';
import 'brace/theme/github';
const AceEditor = require('react-ace').default;
export interface Props extends HTMLAttributes {
value: any;
onChange?: any;
style?: any;
}
export const JsonEditor: FC = ({ value, onChange, style }) => {
return (
{
if (onChange) {
onChange(data);
}
}}
readOnly={onChange === undefined}
wrapEnabled={true}
name={`editor-${Math.random()}`}
value={value}
editorProps={{ $blockScrolling: true }}
/>
);
};