import React from 'react';
import { NewSvg } from '../../svg';
import './index.scss';
export default (props) => {
  const { list, itemClick, } = props;

  return (
    list.map(item => {
      return (
        <div className="list-box" key={item.id}>
          <div className="list-title" onClick={() => { itemClick(item.id) }}>
            {item.achievementName || item.title} {item.new && <NewSvg color="#ffb300"/>}
          </div>
          <div className="list-other">
            {item.publisher && <p>发布单位：{item.publisher}</p>}
            <p>发布时间：{(item.publishDate && item.publishDate.split(' ')[0]) || (item.createTime && item.createTime.split(' ')[0])}</p>
            <p><i className="iconfont icon-dianjiliang mr5 font-12" />{item.visits || 0}</p>
          </div>
        </div>
      )
    })
  )
}