import React from 'react';
import RenderHtml from '../../components/render-html';

function CoderDepotReadme({ operate , history , readme , ChangeFile }){
  return(
    <div className="commonBox" id="readme">
      <div className="commonBox-title">
        <span className="mr10">
          <i className="iconfont icon-wenjian1 font-16 color-grey-9 fl mt3"></i>
        </span>
        <span className="commonBox-title-read">README.md</span>
        {
          operate ?
            <a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
              <i className="iconfont icon-bianji6 font-16 color-blue"></i>
            </a>
          :""
        }
      </div>
      <div className="commonBox-info">
        <RenderHtml className="break_word_comments imageLayerParent" value={readme && readme.content} url={history.location}/>
      </div>
    </div>
  )
}
export default CoderDepotReadme;