up
This commit is contained in:
+4
-2
@@ -733,17 +733,19 @@
|
||||
const avatar = conv.avatar_url ? `<img src="${conv.avatar_url}" alt="avatar" class="conversation-avatar-img">` : `<div class="conversation-avatar">${this.getInitials(conv.name)}</div>`;
|
||||
|
||||
const unreadBadge = conv.unread_count && conv.unread_count > 0 ? `<span class="badge bg-danger unread-badge">${conv.unread_count}</span>` : '';
|
||||
const attentionBadge = conv.advisor_requested ? `<span class="badge bg-danger ms-1">¡Atención!</span>` : '';
|
||||
|
||||
// different color if has unread and not active
|
||||
const unreadClass = (conv.unread_count && conv.unread_count > 0 && !isActive) ? 'unread' : '';
|
||||
const attentionClass = conv.advisor_requested ? ' attention' : '';
|
||||
|
||||
return `
|
||||
<div class="conversation-item ${isActive} ${unreadClass}" data-user-id="${conv.user_id}" onclick="chat.openConversation(${conv.user_id}, '${conv.name}', '${conv.phone_number}')">
|
||||
<div class="conversation-item ${isActive} ${unreadClass}${attentionClass}" data-user-id="${conv.user_id}" onclick="chat.openConversation(${conv.user_id}, '${conv.name}', '${conv.phone_number}')">
|
||||
<div class="conversation-avatar-wrapper">
|
||||
${avatar}
|
||||
</div>
|
||||
<div class="conversation-info">
|
||||
<div class="conversation-name">${conv.name} ${unreadBadge}</div>
|
||||
<div class="conversation-name">${conv.name} ${unreadBadge} ${attentionBadge}</div>
|
||||
<div class="conversation-preview">
|
||||
${conv.direction === 'outgoing' ? '✓ ' : ''}${preview}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user