33 lines
		
	
	
		
			711 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			711 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import React, { PropTypes } from 'react';
 | 
						|
import PureComponent from 'react-pure-render/component';
 | 
						|
import NoSSR from 'react-no-ssr';
 | 
						|
import Codemirror from 'react-codemirror';
 | 
						|
 | 
						|
const defaultOptions = {
 | 
						|
  lineNumbers: false,
 | 
						|
  mode: 'javascript',
 | 
						|
  theme: 'monokai',
 | 
						|
  readOnly: 'nocursor',
 | 
						|
  lineWrapping: true
 | 
						|
};
 | 
						|
 | 
						|
export default class extends PureComponent {
 | 
						|
  static displayName = 'Output';
 | 
						|
  static propTypes = {
 | 
						|
    output: PropTypes.string
 | 
						|
  };
 | 
						|
  render() {
 | 
						|
    const { output } = this.props;
 | 
						|
    return (
 | 
						|
      <div className='challenge-log'>
 | 
						|
        <NoSSR>
 | 
						|
          <Codemirror
 | 
						|
            options={ defaultOptions }
 | 
						|
            value={ output }
 | 
						|
          />
 | 
						|
        </NoSSR>
 | 
						|
      </div>
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 |