/* Componentes compartilhados — Login, Sidebar, Topbar, widgets */ const { useState:uS, useEffect:uE, useRef:uR } = React; /* ---------------- LOGIN ---------------- */ function Login({onLogin}){ const [perfil,setPerfil]=uS('ceo'); const [show,setShow]=uS(false); const [remember,setRemember]=uS(true); const [email,setEmail]=uS('jean.barbosa@maximiano.adv.br'); const [pwd,setPwd]=uS('••••••••••'); const [loading,setLoading]=uS(false); const sel=MX.perfis.find(p=>p.id===perfil); uE(()=>{ const map={ceo:'jean.barbosa',gestor:'joao.mendes',adv:'jackeline.batista',admin:'rodrigo'}; setEmail(map[perfil]+'@maximiano.adv.br'); },[perfil]); const submit=(e)=>{ e.preventDefault(); setLoading(true); setTimeout(()=>onLogin(perfil),650); }; return (
Maximiano
Advogados

Portal Interno do escritório.

Comunicação, faturamento, inteligência gerencial e atualização jurídica — reunidos em um só ambiente, seguro e controlado por perfil de acesso.

ACESSO RESTRITO · COLABORADORES MAXIMIANO ADVOGADOS
Bem-vindo de volta

Acessar o portal

Entre com suas credenciais corporativas.
setEmail(e.target.value)} autoComplete="off"/>
setPwd(e.target.value)}/>
setRemember(r=>!r)}> {remember && } Manter conectado
e.preventDefault()}>Esqueci a senha
Demonstração — entrar como
{MX.perfis.map(p=>( ))}
Conexão segura · MFA disponível · Sem cadastro público
); } /* ---------------- SIDEBAR ---------------- */ function Sidebar({active,onNav,profile,unreadFeed,onLogout,allowed,open,onClose}){ const nav=[ {id:'dashboard',label:'Dashboard',icon:'dashboard'}, {id:'feed',label:'Comunicação',icon:'megaphone',badge:unreadFeed}, {id:'faturamento',label:'Faturamento',icon:'wallet'}, {id:'juridico',label:'Jurídico em Foco',icon:'scale'}, {id:'gestao',label:'Gestão',icon:'users'}, ].filter(n=>allowed.includes(n.id)); const showConfig=allowed.includes('config'); return ( <>
); } /* ---------------- TOPBAR ---------------- */ function Topbar({title,crumb,profile,onSwitch,right,onMenuOpen}){ const [menu,setMenu]=uS(null); // 'profile' | 'notif' | null const ref=uR(null); uE(()=>{ const h=e=>{ if(ref.current && !ref.current.contains(e.target)) setMenu(null); }; document.addEventListener('mousedown',h); return ()=>document.removeEventListener('mousedown',h); },[]); const [notifs,setNotifs]=uS(MX.notifications); const unread=notifs.filter(n=>n.unread).length; const notifColors={gold:['#f5edde','#9a743b'],green:['#e7f0ea','#3f7a57'],red:['#f3e6e3','#a8554a'],navy:['#eef0f4','#3a4159']}; return (
{crumb}

{title}

{right}
{menu==='notif' && (
Notificações
{notifs.map(n=>{ const[bg,fg]=notifColors[n.cor]; return (
setNotifs(notifs.map(x=>x.id===n.id?{...x,unread:false}:x))}>
{n.titulo}
{n.msg}
{n.tempo}
{n.unread && }
); })}
)}
{menu==='profile' && (
Trocar de perfil (demo)
{MX.perfis.map(p=>( ))}
)}
); } /* ---------------- WIDGETS ---------------- */ function KPI({label,icon,value,delta,deltaLabel,spark,sparkColor}){ return (
{label}
{value}
{delta!=null && =0?'up':'down')}> =0?'arrowUp':'arrowDown'} size={12} stroke={2.5}/>{Math.abs(delta).toLocaleString('pt-BR',{minimumFractionDigits:1,maximumFractionDigits:1})}% } {deltaLabel}
{spark &&
}
); } function Modal({title,onClose,children,foot}){ return (
{if(e.target===e.currentTarget)onClose();}}>

{title}

{children}
{foot &&
{foot}
}
); } Object.assign(window,{ Login, Sidebar, Topbar, KPI, Modal });