Use dynamic favicon in root sidebar

This commit is contained in:
MOH
2026-03-07 18:44:00 +01:00
parent 02891ec45b
commit 4f39c097e4
3 changed files with 28 additions and 6 deletions
+14 -2
View File
@@ -18,6 +18,7 @@ type DashboardLayoutProps = {
description: string;
icon?: LucideIcon;
items: RootNavItem[];
sidebarIconSrc?: string;
sidebarTop?: ReactNode;
sidebarFooter?: ReactNode;
headerActions?: ReactNode;
@@ -29,6 +30,7 @@ export function DashboardLayout({
description,
icon: Icon,
items,
sidebarIconSrc,
sidebarTop,
sidebarFooter,
headerActions,
@@ -38,7 +40,12 @@ export function DashboardLayout({
<div className="min-h-screen bg-muted/30">
<div className="grid min-h-screen lg:grid-cols-[280px_minmax(0,1fr)]">
<aside className="hidden border-r border-border/70 bg-sidebar/60 lg:sticky lg:top-0 lg:block lg:h-screen">
<DashboardSidebar items={items} top={sidebarTop} footer={sidebarFooter} />
<DashboardSidebar
items={items}
iconSrc={sidebarIconSrc}
top={sidebarTop}
footer={sidebarFooter}
/>
</aside>
<div className="flex min-w-0 flex-1 flex-col">
@@ -54,7 +61,12 @@ export function DashboardLayout({
<SheetTitle>{title}</SheetTitle>
<SheetDescription>{description}</SheetDescription>
</SheetHeader>
<DashboardSidebar items={items} top={sidebarTop} footer={sidebarFooter} />
<DashboardSidebar
items={items}
iconSrc={sidebarIconSrc}
top={sidebarTop}
footer={sidebarFooter}
/>
</SheetContent>
</Sheet>