diff --git a/src/modules/management/pages/AdminPage.jsx b/src/modules/management/pages/AdminPage.jsx index d1ba52a..5d8e7a6 100644 --- a/src/modules/management/pages/AdminPage.jsx +++ b/src/modules/management/pages/AdminPage.jsx @@ -58,6 +58,49 @@ const initialNotices = [ { id: 'n2', text: 'Templates de abertura ativa atualizados para WhatsApp.' }, ]; +const integrationCards = [ + { + id: 'whatsapp', + group: 'Canal', + name: 'WhatsApp', + icon: 'WA', + color: '#20a45b', + description: 'Canal principal para atendimento, abertura ativa e continuidade das conversas no chat.', + }, + { + id: 'sms', + group: 'Canal', + name: 'SMS', + icon: 'SM', + color: '#00a4b7', + description: 'Envio de comunicados curtos, confirmações e mensagens transacionais para contatos sem WhatsApp.', + }, + { + id: 'email', + group: 'Canal', + name: 'Email', + icon: 'EM', + color: '#d8891c', + description: 'Recebimento e resposta de demandas por email dentro da fila omnichannel.', + }, + { + id: 'sharepoint', + group: 'Integração', + name: 'SharePoint', + icon: 'SP', + color: '#036c70', + description: 'Permite que a IA visualize documentos autorizados para alimentar e manter a base de conhecimento.', + }, + { + id: 'gupy', + group: 'Integração', + name: 'Gupy', + icon: 'GP', + color: '#7b4cc2', + description: 'Conecta vagas abertas e processos dos candidatos para enriquecer a base de conhecimento.', + }, +]; + function formatMinutes(minutes) { if (minutes === null || minutes === undefined || Number.isNaN(Number(minutes))) return 'Sem dados'; return `${Number(minutes)} min`; @@ -163,6 +206,13 @@ export function AdminPage() { const [editUserProfileId, setEditUserProfileId] = useState(''); const [editUserSpecialties, setEditUserSpecialties] = useState([]); const [specialtyToAdd, setSpecialtyToAdd] = useState(''); + const [integrationStates, setIntegrationStates] = useState({ + whatsapp: true, + sms: false, + email: false, + sharepoint: false, + gupy: false, + }); useEffect(() => { let isMounted = true; @@ -1216,6 +1266,186 @@ export function AdminPage() { ); } + function renderChannelsIntegrations() { + const activeCount = integrationCards.filter((item) => integrationStates[item.id]).length; + const channelCount = integrationCards.filter((item) => item.group === 'Canal' && integrationStates[item.id]).length; + const integrationCount = integrationCards.filter((item) => item.group === 'Integração' && integrationStates[item.id]).length; + + return ( +
+ +
+ {[ + { label: 'Ativos', value: activeCount }, + { label: 'Canais habilitados', value: channelCount }, + { label: 'Integrações habilitadas', value: integrationCount }, + ].map((item) => ( +
+ {item.label} + {item.value} +
+ ))} +
+
+ +
+ {integrationCards.map((item) => { + const isEnabled = Boolean(integrationStates[item.id]); + + return ( +
+
+
+ +
+ + {item.group} + + {item.name} +
+
+ + +
+ +

+ {item.description} +

+ +
+ + {isEnabled ? 'Habilitado' : 'Desabilitado'} + + +
+
+ ); + })} +
+
+ ); + } + function renderPlaceholder(title, description) { return ( @@ -1234,7 +1464,7 @@ export function AdminPage() { knowledge: , 'ai-contents': renderAiContents(), audit: renderAudit(), - channels: renderPlaceholder('Canais', 'Status e configurações dos canais conectados.'), + channels: renderChannelsIntegrations(), attendance: (