35 lines
984 B
TypeScript
35 lines
984 B
TypeScript
'use client';
|
|
|
|
import { usePathname } from 'next/navigation';
|
|
import Sidebar from '@/components/Sidebar';
|
|
import Header from '@/components/Header';
|
|
import RecentAssets from '@/components/RecentAssets';
|
|
|
|
// Pages that should not have the app shell (sidebar/header)
|
|
const FULL_SCREEN_PAGES = ['/login', '/signup'];
|
|
|
|
export default function AppShell({ children }: { children: React.ReactNode }) {
|
|
const pathname = usePathname();
|
|
|
|
// Check if current page should be full screen (no sidebar/header)
|
|
const isFullScreen = FULL_SCREEN_PAGES.includes(pathname);
|
|
|
|
if (isFullScreen) {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
return (
|
|
<div className="flex h-screen">
|
|
<Sidebar />
|
|
<div className="flex-1 flex flex-col overflow-hidden">
|
|
<Header />
|
|
<div className="flex flex-1 overflow-hidden">
|
|
<main className="flex-1 overflow-y-auto p-6">
|
|
{children}
|
|
</main>
|
|
<RecentAssets />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|