import React, {Component, PropTypes} from 'react'; import Editor from '../components/base/Editor'; import ResponseBodyWebview from '../components/ResponseBodyWebview'; import {PREVIEW_MODE_FRIENDLY, PREVIEW_MODE_SOURCE} from '../lib/previewModes'; class ResponseViewer extends Component { render () { const { previewMode, contentType, editorLineWrapping, editorFontSize, body, url } = this.props; switch (previewMode) { case PREVIEW_MODE_FRIENDLY: return ( ); case PREVIEW_MODE_SOURCE: return ( ); default: // Raw return (
            {body}
          
) } } } ResponseViewer.propTypes = { body: PropTypes.string.isRequired, contentType: PropTypes.string.isRequired, previewMode: PropTypes.string.isRequired, editorFontSize: PropTypes.number.isRequired, editorLineWrapping: PropTypes.bool.isRequired, url: PropTypes.string.isRequired }; export default ResponseViewer;