diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue index 95dbccc..9a5f48f 100644 --- a/src/layouts/AppLayout.vue +++ b/src/layouts/AppLayout.vue @@ -8,29 +8,46 @@ 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 = [ +// Expandable menu states +const leadsOpen = ref(true) +const workflowsOpen = ref(false) + +// Main navigation items +const mainNavItems = [ { name: 'Inbox', path: '/inbox', icon: 'inbox' }, - { name: 'Dashboard', path: '/', icon: 'chart-pie' }, + { name: 'Chancen', path: '/pipeline', icon: 'opportunities' }, { name: 'Leads', icon: 'leads', + expandable: 'leads', children: [ - { name: 'Kontakte', path: '/contacts', icon: 'users' }, - { name: 'Firmen', path: '/companies', icon: 'building-office' }, + { name: 'Alle Leads', path: '/leads', icon: 'list' }, ] }, - { name: 'Pipeline', path: '/pipeline', icon: 'funnel' }, - { name: 'Aktivitäten', path: '/activities', icon: 'clipboard-list' }, + { name: 'Kontakte', path: '/contacts', icon: 'contacts' }, + { name: 'Firmen', path: '/companies', icon: 'companies' }, + { name: 'Aktivitäten', path: '/activities', icon: 'activities' }, + { name: 'Konversationen', path: '/conversations', icon: 'conversations', badge: 'soon' }, + { + name: 'Workflows', + icon: 'workflows', + expandable: 'workflows', + badge: 'soon', + children: [ + { name: 'Automatisierungen', path: '/workflows/automations', icon: 'automation' }, + ] + }, + { name: 'Berichte', path: '/reports', icon: 'reports', badge: 'soon' }, ] -// Team nav item only for admin/owner -const navItems = computed(() => { - const items = [...baseNavItems] +// Bottom navigation items +const bottomNavItems = computed(() => { + const items = [] if (auth.user?.role === 'owner' || auth.user?.role === 'admin') { - items.push({ name: 'Team', path: '/team', icon: 'user-group' }) + items.push({ name: 'Team', path: '/team', icon: 'team' }) } + items.push({ name: 'Einstellungen', path: '/settings', icon: 'settings' }) return items }) @@ -46,10 +63,6 @@ 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(() => { @@ -60,8 +73,15 @@ function toggleSidebar() { sidebarOpen.value = !sidebarOpen.value } -function toggleLeads() { - leadsOpen.value = !leadsOpen.value +function toggleExpand(key) { + if (key === 'leads') leadsOpen.value = !leadsOpen.value + if (key === 'workflows') workflowsOpen.value = !workflowsOpen.value +} + +function isExpanded(key) { + if (key === 'leads') return leadsOpen.value + if (key === 'workflows') return workflowsOpen.value + return false } function closeSidebarOnMobile() { @@ -80,8 +100,9 @@ function isActive(path) { return route.path.startsWith(path) } -function isLeadsActive() { - return route.path.startsWith('/contacts') || route.path.startsWith('/companies') +function isGroupActive(item) { + if (!item.children) return false + return item.children.some(child => route.path.startsWith(child.path)) } @@ -126,15 +147,16 @@ function isLeadsActive() { 'w-64' ]" > - -
-
-
- - - -
- Pulse + +
+
+ {{ auth.user?.firstName?.[0] || 'U' }}{{ auth.user?.lastName?.[0] || '' }} +
+
+

+ {{ auth.user?.firstName }} {{ auth.user?.lastName }} +

+

Pulse CRM

- -