import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import { getImageUrl } from 'educoder';
import RenderHtml from "../../components/render-html";

import Customers from '../CustomComponent/Index'
import "./manage.css"

class ItemLeft extends Component {

  render(){
    // user_url,username , time , image_url :用户链接，用户名,时间，头像,
    // memo_title , forum_title（待审查帖子以及已发布帖子：帖子名称，发表的论坛名）
    // source_title , reply_content（待审查回复：帖子来源，回复内容）
    //memo_id,forum_id,source_id（ 待审查帖子id，发表在版块id,来源版块id）
    const {user_url,id, memo_id,username , time , image_url , memo_title , forum_title ,source_title , reply_content,forum_id,source_id} = this.props;
    const title_Url= id || memo_id;
    return(
      
      <div className="flex1">
        <p className="flex-align-center mb15">
          <Customers className="ItemsHeadPhoto flex-align-center"  hrefUrl={user_url} img_url={getImageUrl(`images/${image_url}`)} name={username}></Customers>
          <span className="sendPoint">{time}</span>
          { forum_title && <span className="sendPoint">发表在 <Link to={`/forums/theme/${forum_id}`}><span className="green">{forum_title}</span></Link></span> }
          { source_title && <span className="sendPoint">来源 <Link to={`/forums/theme/${source_id}`}><span className="green">{source_title}</span></Link></span> }
        </p>
        { memo_title && <p><Link to={`/forums/${title_Url}`}>{memo_title}</Link></p>}
        {
          reply_content &&
          <Link to={`/forums/${title_Url}/detail`}>
            <RenderHtml className="reply_manage_content" value={reply_content} />
          </Link>
        }
      </div>

    )
  }
}

export default ItemLeft;