1- import type { ReactNode } from "react" ;
21import { SidebarProvider , SidebarInset , SidebarTrigger , useSidebar } from "@/components/sidebar" ;
32import { AppShellOutlet } from "@/components/content" ;
43import { ThemeSwitcher } from "@/components/theme-switcher" ;
54import { DefaultSidebar } from "./default-sidebar" ;
65import { DynamicBreadcrumb } from "@/components/dynamic-breadcrumb" ;
76
87export type SidebarLayoutProps = {
9- /**
10- * Header theme control.
11- *
12- * @default Built-in **`ThemeSwitcher`** menu (all themes + **System**).
13- * Pass **`null`** to hide. Pass a custom **`ReactNode`** to replace.
14- */
15- themeSwitcher ?: ReactNode ;
16-
178 /**
189 * Custom content renderer.
1910 *
@@ -75,7 +66,6 @@ const HidableSidebarTrigger = () => {
7566
7667export const SidebarLayout = ( props : SidebarLayoutProps ) => {
7768 const Children = props . children ? props . children ( { Outlet : AppShellOutlet } ) : null ;
78- const themeSwitcher = props . themeSwitcher !== undefined ? props . themeSwitcher : < ThemeSwitcher /> ;
7969
8070 return (
8171 < SidebarProvider
@@ -92,9 +82,9 @@ export const SidebarLayout = (props: SidebarLayoutProps) => {
9282 < HidableSidebarTrigger />
9383 < DynamicBreadcrumb />
9484 </ div >
95- { themeSwitcher !== null ? (
96- < div className = "astw:flex astw:items-center astw:gap-2" > { themeSwitcher } </ div >
97- ) : null }
85+ < div className = "astw:flex astw:items-center astw:gap-2" >
86+ < ThemeSwitcher / >
87+ </ div >
9888 </ div >
9989 </ header >
10090 < div className = "astw:flex astw:flex-col astw:gap-4 astw:flex-1 astw:min-h-0" >
0 commit comments