import React, {Component} from 'react'
import {PlainMessage} from 'karaui'
import iCss from './item.scss'
import getHighLightText from '../../../../utils/getHighLightText'

export default class FriendItem extends Component {

  //定义tab标签
  constructor(props) {
    super(props);
    this.state = {}

  }

  seeDetail = () => {
    const {history, data} = this.props;
    history.push(`/group/momentDetail/${data.id}`)

  }

  render() {
    const {data, closeSearchModal} = this.props;
    const {headIcon, nickName} = data.userInfo;
    return (
      <li className={iCss["f-item"]} onClick={() => {
        this.seeDetail();
        closeSearchModal();
      }}>

        <div className={`${iCss["f-h-img"]} s-bg-info`}>
          <img src={headIcon} alt=""/>
        </div>

        <div className={iCss["f-detail"]}>
          <p className={iCss["f-name"]}>{nickName}</p>
          <PlainMessage text={ data.content}/>
          <p className={`${iCss["f-date"]} s-hint`}>{data.createTime}</p>
        </div>
      </li>
    )


  }


}
