From 78b63e72c231337bbfc5dd6383af257b5aa6c9da Mon Sep 17 00:00:00 2001 From: Rafael Lopes Date: Wed, 27 May 2026 09:31:25 -0300 Subject: [PATCH] FEAT: Ajustes no na pagina do Admin --- .../pages/AgentNewAttendancePage.jsx | 138 +++++ .../chat/components/ContactProfilePanel.jsx | 4 +- src/modules/home/pages/ContactsPage.jsx | 394 ++++++------ .../components/ManagementLayout.jsx | 14 +- .../components/OperationalDashboard.jsx | 36 +- src/modules/management/pages/AdminPage.jsx | 567 ++++++++++++++++-- .../management/pages/SupervisorPage.jsx | 3 +- .../management/services/adminAccessService.js | 4 + src/routes/router.jsx | 4 +- 9 files changed, 914 insertions(+), 250 deletions(-) create mode 100644 src/modules/attendance/pages/AgentNewAttendancePage.jsx diff --git a/src/modules/attendance/pages/AgentNewAttendancePage.jsx b/src/modules/attendance/pages/AgentNewAttendancePage.jsx new file mode 100644 index 0000000..7389ed5 --- /dev/null +++ b/src/modules/attendance/pages/AgentNewAttendancePage.jsx @@ -0,0 +1,138 @@ +import { useEffect, useMemo, useState } from 'react'; +import { BrandMark } from '../../../shared/components/BrandMark'; +import { useViewport } from '../../../shared/hooks/useViewport'; +import { getCurrentUserDisplay } from '../../auth/services/sessionService'; +import { listContactProfiles } from '../../chat/services/contactProfileService'; +import { HomeSidebar } from '../../home/components/HomeSidebar'; +import { sidebarItems } from '../../home/services/homeMocks'; +import { NewAttendancePage } from './NewAttendancePage'; + +export function AgentNewAttendancePage() { + const { isDesktop, isMobile } = useViewport(); + const userDisplay = getCurrentUserDisplay(); + const [contactCount, setContactCount] = useState(0); + + useEffect(() => { + let isMounted = true; + + listContactProfiles() + .then((items) => { + if (isMounted) setContactCount(Array.isArray(items) ? items.length : 0); + }) + .catch(() => { + if (isMounted) setContactCount(0); + }); + + return () => { + isMounted = false; + }; + }, []); + + const sidebarWithContactCount = useMemo( + () => sidebarItems.map((item) => (item.id === 'contacts' ? { ...item, count: contactCount } : item)), + [contactCount], + ); + + return ( +
+
+
+
+
+ +
+ +
+ +
+
+
+

Abrir Atendimento

+

+ Inicie um contato ativo por WhatsApp usando mensagens pré-aprovadas. +

+
+ +
+
+ {userDisplay.name} + + Atendimento omnichannel + +
+ +
+
+ + +
+
+
+
+ ); +} diff --git a/src/modules/chat/components/ContactProfilePanel.jsx b/src/modules/chat/components/ContactProfilePanel.jsx index 6e43aed..e6e6e7d 100644 --- a/src/modules/chat/components/ContactProfilePanel.jsx +++ b/src/modules/chat/components/ContactProfilePanel.jsx @@ -140,11 +140,11 @@ export function ContactProfilePanel({ isOpen, contact, onClose, onSaved }) { diff --git a/src/modules/home/pages/ContactsPage.jsx b/src/modules/home/pages/ContactsPage.jsx index 0c19d2c..8263af6 100644 --- a/src/modules/home/pages/ContactsPage.jsx +++ b/src/modules/home/pages/ContactsPage.jsx @@ -56,7 +56,7 @@ function emptyDraft() { }; } -export function ContactsPage() { +export function ContactsPanel({ embedded = false }) { const { isDesktop, isMobile } = useViewport(); const currentUser = getCurrentUser(); const currentUserId = getUserId(currentUser); @@ -146,6 +146,202 @@ export function ContactsPage() { } } + const content = ( +
+ + +
+
+ + {selectedChatId ? 'Editar contato' : 'Novo contato'} + + + O WhatsApp é usado para vincular o contato à conversa. + +
+ +
+ + + + + + + + + +
+ +