Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
15761 stevensc 1
/* eslint-disable react/prop-types */
2
import React from 'react'
3
 
4
const timeOptions = {
5
  minutos: 'mn',
6
  horas: 'h',
7
  días: 'd',
8
  semanas: 's',
9
  meses: 'm',
10
  año: 'a'
11
}
12
 
13
const ContactItem = ({ contact, onClick }) => {
14
  return (
15
        <div className="contacts-list__item">
16
            <img
17
                className="chat-image img-circle"
18
                height="36"
19
                width="36"
20
                src={contact.image || '/images/users-group.png'}
21
                alt="image-image"
22
            />
23
            <div className="contacts-list__item-content">
24
                <span onClick={() => onClick(contact)}>{contact.name}</span>
25
                {contact.last_message && <p>{contact.count_not_seen_messages} {CHAT_LABELS.NEW_MESSAGES} |{contact.last_message.split(' ')[0]}{timeOptions[contact.last_message.split(' ')[1]]}</p>}
26
            </div>
27
        </div>
28
  )
29
}
30
 
31
export default ContactItem