Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-12 17:09:39 -08:00
parent 31e65065ab
commit 1b25601a01
17 changed files with 549 additions and 306 deletions

View File

@@ -18,7 +18,7 @@ import {
export default function ConsoleLayout() {
const location = useLocation();
const pathSegments = location.pathname.split('/').filter(Boolean);
const pathSegments = location.pathname.split("/").filter(Boolean);
return (
<SidebarProvider>
@@ -32,15 +32,13 @@ export default function ConsoleLayout() {
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink asChild>
<Link to="/">
Home
</Link>
<Link to="/">Home</Link>
</BreadcrumbLink>
</BreadcrumbItem>
{pathSegments.map((segment, index) => {
const path = `/${pathSegments.slice(0, index + 1).join('/')}`;
const path = `/${pathSegments.slice(0, index + 1).join("/")}`;
const isLast = index === pathSegments.length - 1;
return (
<React.Fragment key={path}>
<BreadcrumbSeparator />
@@ -52,7 +50,8 @@ export default function ConsoleLayout() {
) : (
<BreadcrumbLink asChild>
<Link to={path}>
{segment.charAt(0).toUpperCase() + segment.slice(1)}
{segment.charAt(0).toUpperCase() +
segment.slice(1)}
</Link>
</BreadcrumbLink>
)}