diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue index 1872594..95dbccc 100644 --- a/src/layouts/AppLayout.vue +++ b/src/layouts/AppLayout.vue @@ -8,12 +8,19 @@ const route = useRoute() const auth = useAuthStore() const sidebarOpen = ref(false) const isMobile = ref(false) +const leadsOpen = ref(true) // Leads submenu open by default const baseNavItems = [ { name: 'Inbox', path: '/inbox', icon: 'inbox' }, { name: 'Dashboard', path: '/', icon: 'chart-pie' }, - { name: 'Kontakte', path: '/contacts', icon: 'users' }, - { name: 'Firmen', path: '/companies', icon: 'building-office' }, + { + name: 'Leads', + icon: 'leads', + children: [ + { name: 'Kontakte', path: '/contacts', icon: 'users' }, + { name: 'Firmen', path: '/companies', icon: 'building-office' }, + ] + }, { name: 'Pipeline', path: '/pipeline', icon: 'funnel' }, { name: 'Aktivitäten', path: '/activities', icon: 'clipboard-list' }, ] @@ -39,6 +46,10 @@ function checkMobile() { onMounted(() => { checkMobile() window.addEventListener('resize', checkMobile) + // Auto-expand leads if on contacts or companies page + if (route.path.startsWith('/contacts') || route.path.startsWith('/companies')) { + leadsOpen.value = true + } }) onUnmounted(() => { @@ -49,6 +60,10 @@ function toggleSidebar() { sidebarOpen.value = !sidebarOpen.value } +function toggleLeads() { + leadsOpen.value = !leadsOpen.value +} + function closeSidebarOnMobile() { if (isMobile.value) { sidebarOpen.value = false @@ -64,6 +79,10 @@ function isActive(path) { if (path === '/') return route.path === '/' return route.path.startsWith(path) } + +function isLeadsActive() { + return route.path.startsWith('/contacts') || route.path.startsWith('/companies') +}