23 lines
702 B
TypeScript
23 lines
702 B
TypeScript
'use client';
|
|
|
|
import { ReactNode } from 'react';
|
|
import { usePathname } from 'next/navigation';
|
|
import { useSidebar } from '@/lib/SidebarContext';
|
|
import Footer from './Footer';
|
|
|
|
export default function MainContent({ children }: { children: ReactNode }) {
|
|
const pathname = usePathname();
|
|
const { collapsed } = useSidebar();
|
|
const isPublicPage = pathname === '/login' || pathname === '/';
|
|
|
|
return (
|
|
<main
|
|
className="flex-1 min-h-screen p-6 page-enter transition-all duration-300 flex flex-col"
|
|
style={{ marginLeft: isPublicPage ? '0' : (collapsed ? '60px' : '260px') }}
|
|
>
|
|
<div className="flex-1">{children}</div>
|
|
{!isPublicPage && <Footer />}
|
|
</main>
|
|
);
|
|
}
|