3v324v23's picture
Merge Conflict solved | Build error solved
205f25f
Raw History Blame Contribute Delete
999 Bytes
'use client';
import { Sidebar } from './Sidebar';
import { Header } from './Header';
import { useBeFreeStore } from '@/store/befree-store';
interface AppLayoutProps {
children: React.ReactNode;
}
export function AppLayout({ children }: AppLayoutProps) {
// Read state from global store to calculate dynamic margins
const isSidebarOpen = useBeFreeStore((state) => state.isSidebarOpen);
return (
<div className="h-screen bg-background overflow-hidden">
<Sidebar />
<div
// Transition added to slide content smoothly with the sidebar animation
className="flex flex-col h-screen transition-all duration-250 ease-in-out"
style={{ marginLeft: isSidebarOpen ? '260px' : '72px' }}
>
<Header />
<main
className="flex-1 overflow-y-auto"
style={{ marginTop: '64px' }}
>
<div className="w-full h-full">{children}</div>
</main>
</div>
</div>
);
}