diff --git a/apps/console/src/layouts/ConsoleLayout.tsx b/apps/console/src/layouts/ConsoleLayout.tsx index f199ac72c..f1bb3e7d6 100644 --- a/apps/console/src/layouts/ConsoleLayout.tsx +++ b/apps/console/src/layouts/ConsoleLayout.tsx @@ -1,5 +1,6 @@ -import { Outlet } from "react-router"; +import { Outlet, useLocation } from "react-router"; import { AppSidebar } from "@/components/AppSidebar"; +import React from "react"; import { Breadcrumb, BreadcrumbItem, @@ -14,9 +15,11 @@ import { SidebarProvider, SidebarTrigger, } from "@/components/ui/sidebar"; -import { graphql } from "relay-runtime"; export default function ConsoleLayout() { + const location = useLocation(); + const pathSegments = location.pathname.split('/').filter(Boolean); + return ( @@ -27,15 +30,30 @@ export default function ConsoleLayout() { - - - Building Your Application - - - - Data Fetching + Home + {pathSegments.map((segment, index) => { + const path = `/${pathSegments.slice(0, index + 1).join('/')}`; + const isLast = index === pathSegments.length - 1; + + return ( + + + + {isLast ? ( + + {segment.charAt(0).toUpperCase() + segment.slice(1)} + + ) : ( + + {segment.charAt(0).toUpperCase() + segment.slice(1)} + + )} + + + ); + })}