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

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

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

    return <div
        className={style["copyModal"]}
        style={copyVisible ? { display: "block" } : { display: "none" }}
      >
        <div className={style["shade"]} onClick={closeCopyModal}/>
        <div className={style["copyContent"]} id="CopyModalWrap">
          <div className={`${style["header"]} drag-title`} id="CopyModalTitle">版本信息<img src={close} onClick={closeCopyModal} /></div>
          <div className={style["now"]}>
            当前版本：{number}
            <span>{date && date.substring(0, 10)}</span>
          </div>
          <div className={style["content"]}>{copyContent}</div>
        </div>
      </div>
  }
}

export default DiscontentSon;
