import React, { Component } from 'react';
import PropTypes from 'prop-types';
import sanitizeHtml from 'sanitize-html';

import './output.css';
import { isEmpty } from 'lodash';

const propTypes = {
  defaultOutput: PropTypes.string,
  output: PropTypes.arrayOf(PropTypes.string)
};

class Output extends Component {
  render() {
    const { output, defaultOutput } = this.props;
    console.log('output', output);
    const message = sanitizeHtml(
      !isEmpty(output) ? output.join('\n') : defaultOutput,
      {
        allowedTags: ['b', 'i', 'em', 'strong', 'code', 'wbr']
      }
    );
    return (
      <pre
        className='output-text'
        dangerouslySetInnerHTML={{ __html: message }}
      />
    );
  }
}

Output.displayName = 'Output';
Output.propTypes = propTypes;

export default Output;

@@ -377,43 +377,8 @@
 ps;%0A
-    console.log('output', output);%0A
     

remove unwanted log (#39312)