"use client"; import { AuthGuard, LoginGuard } from "@/contexts"; import { useIsMobile } from "@/hooks/use-mobile"; import { usePathname } from "next/navigation"; import type { PropsWithChildren } from "react"; import { Header } from "./header"; import Notification from "./notification"; import { Sidebar } from "./sidebar"; function MainLayout({ children }: PropsWithChildren) { const isMobile = useIsMobile(); return (
{/* Spacer to reserve space for collapsed sidebar on mobile - avoids reflow */} {isMobile &&
}
{children}
); } export function ConditionalLayout({ children }: PropsWithChildren) { const pathname = usePathname(); const isAuthPage = pathname.startsWith("/auth"); return ( <> {isAuthPage ? (
{children}
) : ( {children} )} ); }