import React, { useEffect, useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { Zap, LayoutDashboard, Users, Inbox, Handshake, PieChart, ChevronLeft, ChevronRight, } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import GoogleAuthBar from '@/components/layout/GoogleAuthBar'; const NAV_ITEMS = [ { label: 'Campaigns', href: '/', icon: LayoutDashboard }, { label: 'Contacts', href: '/contacts', icon: Users }, { label: 'Leads', href: '/leads', icon: Inbox }, { label: 'Deals', href: '/deals', icon: Handshake }, { label: 'Dashboard', href: '/dashboard', icon: PieChart }, ]; const SIDEBAR_COLLAPSED_KEY = 'sequenceai-sidebar-collapsed'; function pathMatches(locationPath, href) { if (href === '/') return locationPath === '/'; return locationPath === href || locationPath.startsWith(`${href}/`); } export default function AppShell({ title, subtitle, rightContent, children }) { const location = useLocation(); const [sidebarCollapsed, setSidebarCollapsed] = useState(() => { try { if (typeof window === 'undefined') return true; const v = localStorage.getItem(SIDEBAR_COLLAPSED_KEY); if (v === null || v === '') return true; return v === '1'; } catch { return true; } }); useEffect(() => { try { localStorage.setItem(SIDEBAR_COLLAPSED_KEY, sidebarCollapsed ? '1' : '0'); } catch { /* ignore */ } }, [sidebarCollapsed]); return (
CRM Workspace
{subtitle}
: null}