/**
*
* Edmeditor
*
*/

import PropTypes from 'prop-types';

import React from 'react';
// import styled from 'styled-components';

// import { FormattedMessage } from 'react-intl';
// import messages from './messages';
// const loadScript = require('load-script');
// const defaultScriptUrl = "https://api-static.edmdesigner.com/EDMdesignerAPI.js";

class Edmeditor extends React.Component { // eslint-disable-line react/prefer-stateless-function
  constructor(props) {
    super(props);
    this.state = {
      editorInstance: undefined,
    };

    // this.onLoad = this.onLoad.bind(this);
  }

  componentDidMount() {
    
  }

  componentWillReceiveProps(nextProps) {
    
    // if (!_.isEqual(nextProps.content, this.props.content)) {
    //   
    //   this.editorInstance.content = nextProps.content;
    // }
  }

  componentWillUnmount() {
    this.unmounting = true;
  }

  render() {
    
    return (
      this.props.edmSrc ?
        (<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
      : 'aaasass'
    );
  }
}

Edmeditor.defaultProps = {
  id: 'edmEditor',
  activeClass: "",
};

Edmeditor.propTypes = {
  id: PropTypes.string,
  activeClass: PropTypes.string,
  // getEditorInstanse: PropTypes.func,
  edmSrc: PropTypes.string,
};

export default Edmeditor;
