fix: refactor

This commit is contained in:
shinya
2025-06-19 23:03:37 +08:00
parent 29f729df54
commit 8e4781f44c
23 changed files with 221 additions and 1513 deletions

View File

@@ -0,0 +1,26 @@
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;