diff --git a/app/[orgId]/problems/page.tsx b/app/[orgId]/problems/page.tsx index 38882f7..1e12d0a 100644 --- a/app/[orgId]/problems/page.tsx +++ b/app/[orgId]/problems/page.tsx @@ -31,11 +31,11 @@ export default function ProblemsPage({ setProblems(data); } catch (error) { console.error("Error fetching problems:", error); - toast({ - title: "Error fetching problems", - description: "Using mock data as fallback", - variant: "destructive", - }); + // toast({ + // title: "Error fetching problems", + // description: "Using mock data as fallback", + // variant: "destructive", + // }); setProblems(mockProblems); } }; diff --git a/components/app-sidebar.tsx b/components/app-sidebar.tsx index 8dcda47..35c11b9 100644 --- a/components/app-sidebar.tsx +++ b/components/app-sidebar.tsx @@ -192,6 +192,18 @@ export function AppSidebar({ children }: { children: React.ReactNode }) { // Get the base path (e.g., /[orgId]) const basePath = pathname.split("/").slice(0, 2).join("/"); + // Utility function to generate breadcrumbs from pathname + const generateBreadcrumbs = (pathname: string) => { + const paths = pathname.split("/").filter(Boolean); + return paths.map((path) => ({ + href: "/" + paths.slice(0, paths.indexOf(path) + 1).join("/"), + label: path + .split("-") + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" "), + })); + }; + return ( @@ -383,15 +395,24 @@ export function AppSidebar({ children }: { children: React.ReactNode }) { - - - Building Your Application - - - - - Data Fetching - + {generateBreadcrumbs(usePathname()).map( + (crumb, index, array) => ( + + + {index === array.length - 1 ? ( + {crumb.label} + ) : ( + + {crumb.label} + + )} + + {index < array.length - 1 && ( + + )} + + ), + )}