Rev 15801 | Rev 15824 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from "react";
export default ({ conversations, onClick, selectedConversation }) => {
return (
<div className="messages-list">
<ul>
{conversations ? (
conversations.map((element, i) => {
return (
<li
key={i}
className={selectedConversation === element && "active"}
onClick={() => onClick(element)}
>
<div className="usr-msg-details">
<div className="usr-ms-img">
{element.image && (
<a href={element.image} target="_blank">
<img src={element.image} alt={element.name} />
</a>
)}
</div>
<div className="usr-mg-info">
<h3>{element.name}</h3>
</div>
<div
className={element.online ? "online-btn" : "offline-btn"}
>
<span>{element.online ? "Online" : "Offline"}</span>
<i></i>
</div>
</div>
</li>
);
})
) : (
<li className="active">
<div className="usr-msg-details">
<div className="usr-mg-info">
<h3>Sin conversaciones</h3>
</div>
</div>
</li>
)}
</ul>
</div>
);
};