From 217d566057941065d6e29fe4f153ac0e889be32c Mon Sep 17 00:00:00 2001 From: Rafael Lopes Date: Tue, 19 May 2026 15:29:43 -0300 Subject: [PATCH] =?UTF-8?q?FEAT:=20Adicionado=20estiliza=C3=A7=C3=A3o=20co?= =?UTF-8?q?m=20nome=20do=20agente,=20configura=C3=A7=C3=A3o=20de=20fila,?= =?UTF-8?q?=20e=20responsividade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chat/components/ChatConversationList.jsx | 65 +++- .../chat/components/ChatTransferPanel.jsx | 36 +- src/modules/chat/components/ChatWindow.jsx | 131 ++++++- src/modules/chat/hooks/useChat.js | 358 +++++++++++++++--- src/modules/chat/pages/ChatPage.jsx | 13 + .../home/components/MessagesWorkspace.jsx | 41 +- src/modules/home/services/homeMocks.js | 2 +- 7 files changed, 537 insertions(+), 109 deletions(-) diff --git a/src/modules/chat/components/ChatConversationList.jsx b/src/modules/chat/components/ChatConversationList.jsx index 914ade2..50515cd 100644 --- a/src/modules/chat/components/ChatConversationList.jsx +++ b/src/modules/chat/components/ChatConversationList.jsx @@ -46,6 +46,32 @@ function PresenceDot({ status }) { ); } +function UnreadBadge({ count }) { + if (!count) return null; + + return ( + + {count > 99 ? '99+' : count} + + ); +} + +const CHAT_LIST_HEIGHT = 'min(640px, calc(100vh - 220px))'; + export function ChatConversationList({ contacts, activeContactId, @@ -62,7 +88,9 @@ export function ChatConversationList({ display: 'grid', gridTemplateRows: 'auto minmax(0, 1fr)', gap: '0.85rem', - height: isMobile ? 'auto' : 'min(760px, calc(100vh - 190px))', + height: isMobile ? 'auto' : CHAT_LIST_HEIGHT, + maxHeight: isMobile ? 'none' : CHAT_LIST_HEIGHT, + alignSelf: 'start', minHeight: 0, }} > @@ -78,6 +106,8 @@ export function ChatConversationList({ display: 'grid', gap: '0.75rem', gridTemplateColumns: isMobile ? '1fr' : '1fr', + gridAutoRows: 'max-content', + alignContent: 'start', overflowY: 'auto', minHeight: 0, paddingRight: '0.15rem', @@ -115,27 +145,28 @@ export function ChatConversationList({
- {contact.unread ? ( - - {contact.unread} - - ) : null} +
{contact.preview} ); })} + + {contacts.length === 0 ? ( +
+ Nenhuma conversa ativa na sua fila. Conversas em triagem do Omnino aparecem aqui depois de classificadas. +
+ ) : null} ); diff --git a/src/modules/chat/components/ChatTransferPanel.jsx b/src/modules/chat/components/ChatTransferPanel.jsx index 2470ada..14eb4df 100644 --- a/src/modules/chat/components/ChatTransferPanel.jsx +++ b/src/modules/chat/components/ChatTransferPanel.jsx @@ -4,6 +4,7 @@ export function ChatTransferPanel({ setTransferArea, transferAreas, attendants, + isSameUserArea = true, transferAttendant, setTransferAttendant, transferNote, @@ -69,17 +70,30 @@ export function ChatTransferPanel({