mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
31 lines
654 B
JavaScript
31 lines
654 B
JavaScript
import React, {Component, PropTypes} from 'react';
|
|
import Editor from './base/Editor'
|
|
|
|
class RequestBodyEditor extends Component {
|
|
render () {
|
|
const {body, contentType, onChange, className} = this.props;
|
|
|
|
return (
|
|
<Editor
|
|
value={body}
|
|
className={className}
|
|
debounceMillis={400}
|
|
onChange={onChange}
|
|
mode={contentType}
|
|
placeholder="request body here..."
|
|
/>
|
|
)
|
|
}
|
|
}
|
|
|
|
RequestBodyEditor.propTypes = {
|
|
// Functions
|
|
onChange: PropTypes.func.isRequired,
|
|
|
|
// Other
|
|
body: PropTypes.string.isRequired,
|
|
contentType: PropTypes.string.isRequired
|
|
};
|
|
|
|
export default RequestBodyEditor;
|