Rev 5033 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
/* eslint-disable react/prop-types */
import React from 'react'
const timeOptions = {
minutos: 'mn',
horas: 'h',
días: 'd',
semanas: 's',
meses: 'm',
año: 'a'
}
const ContactItem = ({ contact, onClick }) => {
return (
<div className="contacts-list__item">
<img
className="chat-image img-circle"
height="36"
width="36"
src={contact.image || '/images/users-group.png'}
alt="image-image"
/>
<div className="contacts-list__item-content">
<span onClick={() => onClick(contact)}>{contact.name}</span>
{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>}
</div>
</div>
)
}
export default ContactItem