24 lines
556 B
TypeScript
24 lines
556 B
TypeScript
"use client";
|
|
|
|
import { usePathname } from "next/navigation";
|
|
import Sidebar from "@/components/Sidebar";
|
|
import AuthGuard from "@/components/AuthGuard";
|
|
|
|
export default function AppShell({ children }: { children: React.ReactNode }) {
|
|
const pathname = usePathname();
|
|
const isLoginPage = pathname === "/login";
|
|
|
|
if (isLoginPage) {
|
|
return <AuthGuard>{children}</AuthGuard>;
|
|
}
|
|
|
|
return (
|
|
<AuthGuard>
|
|
<Sidebar />
|
|
<main className="flex-1 overflow-auto pt-12 md:pt-0 h-full">
|
|
{children}
|
|
</main>
|
|
</AuthGuard>
|
|
);
|
|
}
|