Files
blog/write-server/src/components/AppShell.tsx
T
2026-06-22 14:59:24 +08:00

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>
);
}