/* global React, Icon */ const THEME_KEY = 'was-theme'; window.THEME_KEY = THEME_KEY; window.Sidebar = function Sidebar({ page, setPage, open, onClose }) { const [pinned, setPinned] = React.useState(false); function togglePin() { setPinned(next => !next); } const data = window.MOCK || {}; const counts = { agents: (data.agents || []).length, conversations: (data.conversations || []).length, tickets: (data.tickets || []).length, channels: (data.channels || []).length, tables: (data.tables || []).length, kb: (data.knowledge || []).length, tools: (data.tools || []).length, squads: (data.squads || []).length, attendants: (data.attendants || []).length, tags: (data.tags || []).length, }; const setupPending = (data.agents || []).filter(agent => !agent.isPublished).length; const sections = [ { label: 'Início', items: [ { id: 'dashboard', label: 'Dashboard', icon: 'dashboard' }, { id: 'ecosystem', label: 'Mapa do Ecossistema', icon: 'ecosystem' }, { id: 'assistants', label: 'Assistentes de IA', icon: 'assistants' }, ]}, { label: 'Fundação', items: [ { id: 'tables', label: 'Tabelas', icon: 'tables', count: counts.tables }, { id: 'kb', label: 'Conhecimento', icon: 'kb', count: counts.kb }, ]}, { label: 'Agentes', items: [ { id: 'agents', label: 'Agentes', icon: 'agents', count: counts.agents }, ]}, { label: 'Orquestração', items: [ { id: 'squads', label: 'Squads', icon: 'squads', count: counts.squads }, { id: 'tools', label: 'Ferramentas', icon: 'tools', count: counts.tools }, { id: 'channels', label: 'Canais', icon: 'channels', count: counts.channels }, ]}, { label: 'Atendimento', items: [ { id: 'tickets', label: 'Tickets', icon: 'tickets', count: counts.tickets }, { id: 'conversations', label: 'Conversas', icon: 'conversations', count: counts.conversations }, { id: 'team', label: 'Atendentes & Times', icon: 'team', count: counts.attendants }, { id: 'tags', label: 'Tags', icon: 'tags', count: counts.tags }, { id: 'logs', label: 'Logs', icon: 'logs' }, ]}, ]; return ( <>
); }; window.TopBar = function TopBar({ crumbs, onMenu, theme, toggleTheme, onNewAgent, loading, error, onSearch, onGuide, guideOpen }) { return (
{crumbs.map((crumb, i) => ( {i > 0 && /} {crumb} ))}
Ctrl K
{loading && sincronizando} {error && offline}
); }; window.Toast = function Toast({ message, type = '' }) { if (!message) return null; return
{message}
; }; window.Modal = function Modal({ open, title, children, onClose }) { if (!open) return null; return (
{title}
{children}
); }; window.Drawer = function Drawer({ open, title, children, onClose }) { return (
{title}
{children}
); }; window.Shell = function Shell({ page, setPage, menuOpen, setMenuOpen, children, topbarProps }) { return (
setMenuOpen(false)}/>
setMenuOpen(true)}/> {children}
); }; window.WaShell = { Sidebar: window.Sidebar, Topbar: window.TopBar, TopBar: window.TopBar, Shell: window.Shell, Toast: window.Toast, Modal: window.Modal, Drawer: window.Drawer, THEME_KEY };