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

export default class NewsItem extends Component {

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

  }

  render () {
    const {data} = this.props

    return (
      <li className={iCss['news-item']}>
        <p className={iCss['news-tit']}>
          <a className="s-link" href={data.url} target="view_window">{getHighLightText(data.title)}</a>
        </p>
        {data.description ? <p className={iCss['news-con']}>{getHighLightText(data.description)}</p> : null}
        <p className={`${iCss['news-time']} s-hint`}>
          <span>{data.date ? data.date : ''}</span>
          <span>{data.from ? data.from : ''}</span>
        </p>
      </li>
    )

  }

}

