// Sidebar component function Sidebar({ route, setRoute, properties, tenants, settings, mobileMenuOpen }) { const tenantCount = tenants ? Object.keys(tenants).length : 0; const platformName = settings?.platformName?.trim() || 'Hausgut'; const ownerName = settings?.ownerName?.trim() || ''; const ownerInitials = ownerName ? ownerName.split(/\s+/).map(s => s[0]).filter(Boolean).slice(0, 2).join('').toUpperCase() : '?'; const NavItem = ({ id, icon, label, count }) => ( ); return ( ); } // Topbar with breadcrumbs function Topbar({ route, setRoute, properties, tenants, onMenuToggle }) { const crumbs = []; if (route.page === 'dashboard') crumbs.push({ label: 'Dashboard' }); else if (route.page === 'properties' && !route.propertyId) crumbs.push({ label: 'Objekte' }); else if (route.propertyId) { crumbs.push({ label: 'Objekte', onClick: () => setRoute({ page: 'properties' }) }); const prop = properties.find(p => p.id === route.propertyId); if (prop) { crumbs.push({ label: prop.name, onClick: route.unitId ? () => setRoute({ page: 'properties', propertyId: prop.id }) : null }); if (route.unitId) { const unit = prop.units.find(u => u.id === route.unitId); if (unit) crumbs.push({ label: unit.label }); } } } else if (route.page === 'tenants' && route.tenantId) { crumbs.push({ label: 'Mieter', onClick: () => setRoute({ page: 'tenants' }) }); const t = tenants?.[route.tenantId]; crumbs.push({ label: t?.name || 'Mieter' }); } else if (route.page === 'tenants') crumbs.push({ label: 'Mieter' }); else if (route.page === 'contacts' && route.contactId) { crumbs.push({ label: 'Kontakte', onClick: () => setRoute({ page: 'contacts' }) }); const ct = (window.DEMO_DATA?.contacts || []).find(c => c.id === route.contactId); if (ct) crumbs.push({ label: ct.company }); } else if (route.page === 'contacts') crumbs.push({ label: 'Kontakte' }); else if (route.page === 'calendar') crumbs.push({ label: 'Kalender' }); else if (route.page === 'maintenance') crumbs.push({ label: 'Wartung' }); else if (route.page === 'contracts') crumbs.push({ label: 'Verträge' }); else if (route.page === 'reports') crumbs.push({ label: 'Berichte' }); else if (route.page === 'tax') crumbs.push({ label: 'Steuer / AfA' }); else if (route.page === 'rent-status') crumbs.push({ label: 'Mieten-Status' }); else if (route.page === 'tasks') crumbs.push({ label: 'Aufgaben' }); else if (route.page === 'analytics') crumbs.push({ label: 'Analytik' }); else if (route.page === 'assistant') crumbs.push({ label: 'KI-Berater' }); else if (route.page === 'messages') crumbs.push({ label: 'Nachrichten' }); else if (route.page === 'settings') crumbs.push({ label: 'Einstellungen' }); return (