|
|
@@ -20,8 +20,7 @@
|
|
|
CreditCard,
|
|
|
HelpCircle,
|
|
|
PieChart,
|
|
|
- Users,
|
|
|
- ShieldCheck
|
|
|
+ Users
|
|
|
} from 'lucide-svelte';
|
|
|
import { goto } from '$app/navigation';
|
|
|
import logoWhite from '$lib/assets/images/nettown_white_logo.svg';
|
|
|
@@ -60,17 +59,21 @@
|
|
|
});
|
|
|
|
|
|
const navItems = [
|
|
|
+ { name: 'Dashboard Executivo', href: '/dashboard/executive', icon: PieChart, adminOnly: true },
|
|
|
{ name: 'Visão Geral', href: '/dashboard', icon: LayoutDashboard },
|
|
|
{ name: 'Interações', href: '/dashboard/interactions', icon: MessageSquare },
|
|
|
{ name: 'Análise de Sentimento', href: '/dashboard/analytics', icon: BarChart2 },
|
|
|
{ name: 'Personas', href: '/dashboard/personas', icon: UserRound },
|
|
|
{ name: 'Evolução', href: '/dashboard/evolucao', icon: TrendingUp },
|
|
|
- { name: 'Configurações', href: '/dashboard/settings', icon: Settings },
|
|
|
- { name: 'Dashboard Executivo', href: '/dashboard/executive', icon: PieChart },
|
|
|
{ name: 'Agentes', href: '/dashboard/operators', icon: Users },
|
|
|
- { name: 'Config. SLA', href: '/dashboard/sla', icon: ShieldCheck }
|
|
|
+ { name: 'Configurações', href: '/dashboard/settings', icon: Settings }
|
|
|
];
|
|
|
|
|
|
+ // Itens com `adminOnly` só aparecem para usuários com papel admin.
|
|
|
+ const visibleNavItems = $derived(
|
|
|
+ navItems.filter((item) => !item.adminOnly || $auth.user?.user_role === 'admin')
|
|
|
+ );
|
|
|
+
|
|
|
function handleLogout() {
|
|
|
auth.logout();
|
|
|
goto('/login');
|
|
|
@@ -188,7 +191,7 @@
|
|
|
>
|
|
|
{isSidebarCollapsed ? 'Menu' : 'Menu Principal'}
|
|
|
</div>
|
|
|
- {#each navItems as item}
|
|
|
+ {#each visibleNavItems as item}
|
|
|
{@const Icon = item.icon}
|
|
|
{@const isActive = isNavItemActive(item.href)}
|
|
|
<a
|