import AppHeader from "@/components/AppHeader"
import { AppSidebar } from "@/containers/AppSidebar"
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"
import { ThemeProvider } from "@/context/ThemeProvider"

export default function MainTemplate({ children, pageTitle }) {
   return (
      <ThemeProvider storageKey="app-theme">
         <SidebarProvider variant="inset">
            <AppSidebar />
            <SidebarInset className="flex flex-col h-screen">
               <AppHeader pageTitle={pageTitle} />
               <main className="flex-1 overflow-x-auto">{children}</main>
            </SidebarInset>
         </SidebarProvider>
      </ThemeProvider>
   )
}
