sarransh's picture
Upload batch 1/2
d1a980e verified
Raw History Blame Contribute Delete
890 Bytes
"use client";
import { useSession } from "next-auth/react";
import Sidebar from "./Sidebar";
import { usePathname } from "next/navigation";
export default function AppShell({ children }: { children: React.ReactNode }) {
const { status } = useSession();
const pathname = usePathname();
// Don't show shell on auth pages
if (pathname.startsWith("/auth") || status === "unauthenticated") {
return <main className="min-h-screen bg-[hsl(var(--background))]">{children}</main>;
}
return (
<div className="flex min-h-screen bg-[hsl(var(--background))]">
<Sidebar />
<main className="flex-1 ml-64 p-8 overflow-y-auto h-screen">
<div className="max-w-7xl mx-auto space-y-8 animate-fade-in">
{children}
</div>
</main>
</div>
);
}