diff --git a/components/dashboard/CompanyHeader.tsx b/components/dashboard/CompanyHeader.tsx index c0439cfb..75cf1b26 100644 --- a/components/dashboard/CompanyHeader.tsx +++ b/components/dashboard/CompanyHeader.tsx @@ -1,88 +1,12 @@ 'use client' import React from 'react' -import { SidebarTrigger } from '@/components/ui/sidebar' -import { Separator } from '@/components/ui/separator' -import { - Breadcrumb, - BreadcrumbItem, - BreadcrumbLink, - BreadcrumbList, - BreadcrumbPage, - BreadcrumbSeparator, -} from '@/components/ui/breadcrumb' -import { usePathname } from 'next/navigation' -import { useCompanyContext } from '@/contexts/CompanyContext' import { NotificationCenter } from '@/components/notifications' export function CompanyHeader() { - const pathname = usePathname() - const { currentCompany } = useCompanyContext() - - // Generate breadcrumbs from pathname - const generateBreadcrumbs = () => { - const paths = pathname.split('/').filter(Boolean) - const breadcrumbs: { label: string; href?: string }[] = [] - - // Start with Dashboard - breadcrumbs.push({ label: 'Dashboard', href: `/dashboard/company/${currentCompany?.slug}` }) - - // Skip 'dashboard' and 'company' and company slug in paths - const relevantPaths = paths.slice(3) - - relevantPaths.forEach((path, index) => { - const label = path - .split('-') - .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(' ') - - if (index === relevantPaths.length - 1) { - // Last item - no link - breadcrumbs.push({ label }) - } else { - // Intermediate items - with link - const href = `/dashboard/company/${currentCompany?.slug}/${relevantPaths - .slice(0, index + 1) - .join('/')}` - breadcrumbs.push({ label, href }) - } - }) - - return breadcrumbs - } - - const breadcrumbs = generateBreadcrumbs() - return ( -
- - - - - {breadcrumbs.map((crumb, index) => ( - - {index > 0 && } - - {crumb.href ? ( - - {crumb.label} - - ) : ( - - {crumb.label} - - )} - - - ))} - - -
- -
+
+
) } diff --git a/components/dashboard/CompanySidebar.tsx b/components/dashboard/CompanySidebar.tsx index 721f7868..37818b59 100644 --- a/components/dashboard/CompanySidebar.tsx +++ b/components/dashboard/CompanySidebar.tsx @@ -10,6 +10,8 @@ import { Menu, Building2, Check, + PanelLeftClose, + PanelLeftOpen, } from 'lucide-react' import { DropdownMenu, @@ -63,7 +65,9 @@ export function CompanySidebar({ header, }: CompanySidebarProps) { const [mobileOpen, setMobileOpen] = useState(false) + const [collapsed, setCollapsed] = useState(false) const closeSidebar = () => setMobileOpen(false) + const toggleCollapsed = () => setCollapsed(!collapsed) const pathname = usePathname() const { navigateTo } = useSafeNavigation() const { currentCompany, userCompanies, switchCompany } = useCompanyContext() @@ -223,8 +227,25 @@ export function CompanySidebar({ {/* desktop sidebar */} -