11'use client' ;
22
33import React from 'react' ;
4- import { useRouter } from 'next/navigation' ;
4+ import { useRouter , usePathname } from 'next/navigation' ;
55import { useProjectStore } from '@/stores' ;
6- import { CheckIcon , ChevronDownIcon , FolderKanban } from 'lucide-react' ;
6+ import { CheckIcon , ChevronDownIcon , Package } from 'lucide-react' ;
77import { Breadcrumb , BreadcrumbItem , BreadcrumbList } from '@/components/ui/breadcrumb' ;
88import {
99 DropdownMenu ,
@@ -16,9 +16,15 @@ import { toast } from 'sonner';
1616
1717export function NavigationBreadcrumb ( ) {
1818 const router = useRouter ( ) ;
19+ const pathname = usePathname ( ) ;
1920 const { currentProjectContext, currentProjectId, projectsContext, fetchProjects } =
2021 useProjectStore ( ) ;
2122
23+ // Don't show breadcrumb on the home or project list page
24+ if ( [ '/' , '/projects' ] . includes ( pathname ) ) {
25+ return null ;
26+ }
27+
2228 const getProjectInitials = ( name : string ) => {
2329 return name
2430 . split ( ' ' )
@@ -91,7 +97,7 @@ export function NavigationBreadcrumb() {
9197 < DropdownMenu onOpenChange = { handleDropdownOpenChange } >
9298 < DropdownMenuTrigger asChild >
9399 < div className = "flex items-center gap-2 cursor-pointer rounded" >
94- < FolderKanban size = { 14 } />
100+ < Package size = { 14 } />
95101 < span > { currentProjectContext . data ?. name } </ span >
96102 < ChevronDownIcon size = { 14 } className = "text-muted-foreground" />
97103 </ div >
0 commit comments