diff --git a/src/App.jsx b/src/App.jsx index 50ffac2..07fcad0 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -76,7 +76,7 @@ function App() { } // Usuário autenticado mas sem permissão para a rota - if (role && !canAccess(role, location.pathname)) { + if (!role || !canAccess(role, location.pathname)) { return ( @@ -183,7 +183,7 @@ function resolveRoute(pathname, navigate, role) { if (pathname === '/camunicacao' || pathname === '/comunicacao' || pathname === '/mensagens') { return { - element: , + element: , title: 'Comunicação', withShell: true, } diff --git a/src/components/AppShell.jsx b/src/components/AppShell.jsx index baa058c..d679658 100644 --- a/src/components/AppShell.jsx +++ b/src/components/AppShell.jsx @@ -9,18 +9,18 @@ const ALL_NAV_ITEMS = [ { href: '/inicio', label: 'Painel', icon: 'pulse', activePaths: ['/inicio', '/home', '/dashboard'] }, { href: '/agenda', label: 'Agenda', icon: 'calendar' }, { href: '/pacientes', label: 'Pacientes', icon: 'users', exact: true }, - { href: '/prontuario', label: 'Prontuario', icon: 'file' }, - { href: '/laudos', label: 'Relatorios medicos', icon: 'clipboard' }, + { href: '/prontuario', label: 'Prontuário', icon: 'file' }, + { href: '/laudos', label: 'Relatórios médicos', icon: 'clipboard' }, { href: '/camunicacao', - label: 'Comunicacao', + label: 'Comunicação', icon: 'message', activePaths: ['/camunicacao', '/comunicacao', '/mensagens'], }, - { href: '/relatorios', label: 'Relatorios', icon: 'chart' }, + { href: '/relatorios', label: 'Relatórios', icon: 'chart' }, { href: '/profissionais', label: 'Profissionais', icon: 'users' }, - { href: '/usuarios', label: 'Usuarios', icon: 'shield' }, - { href: '/configuracoes', label: 'Configuracoes', icon: 'settings', activePaths: ['/configuracoes', '/config'] }, + { href: '/usuarios', label: 'Usuários', icon: 'shield' }, + { href: '/configuracoes', label: 'Configurações', icon: 'settings', activePaths: ['/configuracoes', '/config'] }, ] const titles = { @@ -29,24 +29,24 @@ const titles = { '/dashboard': 'Painel', '/agenda': 'Agenda', '/consultas': 'Consultas', - '/laudos': 'Relatorios medicos', + '/laudos': 'Relatórios médicos', '/pacientes': 'Pacientes', - '/prontuario': 'Prontuario', - '/camunicacao': 'Comunicacao', - '/comunicacao': 'Comunicacao', - '/mensagens': 'Comunicacao', - '/relatorios': 'Relatorios', + '/prontuario': 'Prontuário', + '/camunicacao': 'Comunicação', + '/comunicacao': 'Comunicação', + '/mensagens': 'Comunicação', + '/relatorios': 'Relatórios', '/profissionais': 'Profissionais', '/perfil': 'Perfil', - '/configuracoes': 'Configuracoes', - '/config': 'Configuracoes', - '/usuarios': 'Usuarios', + '/configuracoes': 'Configurações', + '/config': 'Configurações', + '/usuarios': 'Usuários', } export function AppShell({ children, currentPath, navigate, role, routeTitle }) { const [menuOpen, setMenuOpen] = useState(false) const [quickSearch, setQuickSearch] = useState('') - const [viewerProfile, setViewerProfile] = useState({ name: 'Usuario', role: 'Usuario do Sistema' }) + const [viewerProfile, setViewerProfile] = useState({ name: 'Usuário', role: 'Usuário do Sistema' }) const pageTitle = useMemo(() => { if (currentPath.startsWith('/pacientes/') && routeTitle) { @@ -78,8 +78,8 @@ export function AppShell({ children, currentPath, navigate, role, routeTitle }) if (!active || !profile) return setViewerProfile({ - name: profile.name || 'Usuario', - role: ROLE_LABELS[role] || profile.role || 'Usuario do Sistema', + name: profile.name || 'Usuário', + role: ROLE_LABELS[role] || profile.role || 'Usuário do Sistema', }) }) .catch(() => { @@ -87,7 +87,7 @@ export function AppShell({ children, currentPath, navigate, role, routeTitle }) if (active && role) { setViewerProfile((prev) => ({ ...prev, - role: ROLE_LABELS[role] || 'Usuario do Sistema', + role: ROLE_LABELS[role] || 'Usuário do Sistema', })) } }) @@ -108,7 +108,7 @@ export function AppShell({ children, currentPath, navigate, role, routeTitle }) className="sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-[#262626] focus:px-4 focus:py-2 focus:text-sm focus:font-semibold focus:text-[#3b82f6]" href="#app-content" > - Pular para conteudo + Pular para conteúdo