veza/apps/web/src/components/layout/Layout.tsx

31 lines
724 B
TypeScript
Raw Normal View History

import type { ReactNode } from 'react';
import { Header } from './Header';
import { Sidebar } from './Sidebar';
import { useUIStore } from '@/stores/ui';
import { cn } from '@/lib/utils';
interface LayoutProps {
children: ReactNode;
}
export function Layout({ children }: LayoutProps) {
const { sidebarOpen } = useUIStore();
return (
2025-12-13 02:34:34 +00:00
<div className="min-h-screen bg-background">
<Header />
2025-12-13 02:34:34 +00:00
<div className="flex">
<Sidebar />
<main
className={cn(
'flex-1 transition-all duration-200 ease-in-out',
2025-12-13 02:34:34 +00:00
sidebarOpen ? 'md:ml-64' : 'ml-0',
)}
>
2025-12-13 02:34:34 +00:00
<div className="p-6">{children}</div>
</main>
</div>
</div>
);
}