@@ -16,10 +16,7 @@ import {
1616import { AnalyticsProvider , PageViewTracker } from "@/lib/analytics" ;
1717import { useEffect } from "react" ;
1818import { useTheme } from "next-themes" ;
19- import { AppBreadcrumb } from "@/components/apps/breadcrumb" ;
20- import { WorkspaceBreadcrumb } from "@/components/workspace/breadcrumb" ;
21- import { MarketplaceBreadcrumb } from "@/components/marketplace/marketplace-breadcrumb" ;
22- import { ScrollText } from "lucide-react" ;
19+ import { useBreadcrumbStore } from "@/stores" ;
2320
2421const title = "SyftBox" ;
2522const description = "The internet of private data!" ;
@@ -29,6 +26,7 @@ function MainLayout({ children }: { children: React.ReactNode }) {
2926 const sidebarExcludedPaths = [ "/" , "/about/" , "/updates/" ] ;
3027 const shouldShowSidebar = ! sidebarExcludedPaths . includes ( pathname ) ;
3128 const { theme } = useTheme ( ) ;
29+ const { breadcrumbContent } = useBreadcrumbStore ( ) ;
3230
3331 useEffect ( ( ) => {
3432 if ( typeof window !== "undefined" && window . __TAURI__ ) {
@@ -62,29 +60,6 @@ function MainLayout({ children }: { children: React.ReactNode }) {
6260 }
6361 } , [ ] ) ;
6462
65- // Determine which breadcrumb to show based on the current route
66- const getBreadcrumb = ( ) => {
67- if ( pathname . startsWith ( "/apps" ) ) {
68- return < AppBreadcrumb /> ;
69- }
70- if ( pathname . startsWith ( "/workspace" ) ) {
71- return < WorkspaceBreadcrumb /> ;
72- }
73- if ( pathname . startsWith ( "/marketplace" ) ) {
74- return < MarketplaceBreadcrumb /> ;
75- }
76- if ( pathname . startsWith ( "/logs" ) ) {
77- return (
78- < span className = "flex items-center gap-2 p-1 text-sm" >
79- < ScrollText className = "h-4 w-4" />
80- < span > Logs</ span >
81- </ span >
82- ) ;
83- }
84- // For other routes, show nothing
85- return null ;
86- } ;
87-
8863 if ( ! shouldShowSidebar ) {
8964 return (
9065 < div className = "bg-sidebar flex h-screen w-screen" >
@@ -105,7 +80,7 @@ function MainLayout({ children }: { children: React.ReactNode }) {
10580 } }
10681 >
10782 < div className = "bg-sidebar flex h-screen w-screen flex-col" >
108- < TitleBar > { getBreadcrumb ( ) } </ TitleBar >
83+ < TitleBar > { breadcrumbContent } </ TitleBar >
10984 < div className = "flex flex-1 overflow-hidden" >
11085 < Sidebar className = "border-none" >
11186 < AppSidebar />
0 commit comments