import React, { Component } from "react";
import style from "./index.less";
import close from '../../../common/images/icon_close.png'
import { dragBox } from '@utils/drag';
import ReactDom from "react-dom";

class DiscontentSon extends Component {
  constructor(props) {
    super(props);
  }
  componentDidMount(){
    dragBox('CopyModalWrap','CopyModalTitle','add')
  }

  render() {
    const { closeCopyModal,copyVisible,date,copyContent,number } = this.props;

    
    const domNode = document.getElementById('root');
    return ReactDom.createPortal(<React.Fragment>
        <div className={style["shade"]} onClick={closeCopyModal}/>
        <div className={style["copyContent"]} id="CopyModalWrap">
          <div className={`${style["header"]} drag-title`} id="CopyModalTitle">版本信息</div>
          <img src={close} onClick={closeCopyModal} />
          <div className={style["now"]}>
            当前版本：{number}
            <span>{date && date.substring(0, 10)}</span>
          </div>
          <div className={style["content"]}>{copyContent}</div>
        </div>
        </React.Fragment>,domNode)
  }
}

export default DiscontentSon;
