Use h-screen overflow-hidden on the root container for authenticated views. Sidebar and content fill the remaining height below the header. Remove footer from dashboard pages. Content scrolls inside its own container, sidebar stays fixed in place.
24 lines
521 B
TypeScript
24 lines
521 B
TypeScript
'use client'
|
|
|
|
import Sidebar from './Sidebar'
|
|
import { useSidebar } from '@/lib/sidebar-context'
|
|
|
|
export default function DashboardShell({
|
|
siteId,
|
|
children,
|
|
}: {
|
|
siteId: string
|
|
children: React.ReactNode
|
|
}) {
|
|
const { mobileOpen, closeMobile } = useSidebar()
|
|
|
|
return (
|
|
<div className="flex flex-1 overflow-hidden">
|
|
<Sidebar siteId={siteId} mobileOpen={mobileOpen} onMobileClose={closeMobile} />
|
|
<main className="flex-1 min-w-0 overflow-y-auto">
|
|
{children}
|
|
</main>
|
|
</div>
|
|
)
|
|
}
|