import Taro, { Component } from '@tarojs/taro';
import getDateFormat from '@utils/chatDate'
import dayjs from 'dayjs'

import './item.scss'
export default class Index extends Component {
  render() {
    const { data = {} } = this.props
    const timeVal = data.createDate && dayjs(data.createDate).valueOf()
    const time = timeVal && getDateFormat(timeVal, true)

    return (
      <View className='list__item' key={data.uvId}>
        <View className='list__item-info'>
          <Image className='avatar' mode="aspectFill" src={data.photoOravatar}></Image>
          <Text className='name'>{data.nameOrnick}</Text>
        </View>
        <View className='list__item-time'>{time}</View>
      </View>
    )
  }
}