Files
LunaTV/src/components/PageLayout.tsx
2025-06-19 23:03:37 +08:00

27 lines
603 B
TypeScript

import { useSidebar } from './Sidebar';
import Sidebar from './Sidebar';
interface PageLayoutProps {
children: React.ReactNode;
activePath?: string;
}
const PageLayout = ({ children, activePath = '/' }: PageLayoutProps) => {
const { isCollapsed } = useSidebar();
return (
<div className='grid grid-cols-[auto_1fr] w-full'>
<Sidebar activePath={activePath} />
<div
className={`min-w-0 transition-all duration-300 ${
isCollapsed ? 'col-start-2' : 'col-start-2'
}`}
>
{children}
</div>
</div>
);
};
export default PageLayout;