Initial commit for new panel

This commit is contained in:
AmirReza Jamali
2025-09-09 11:20:26 +03:30
commit 1d4ccb3575
343 changed files with 20031 additions and 0 deletions
@@ -0,0 +1,34 @@
"use client";
import { usePathname } from "next/navigation";
import type { PropsWithChildren } from "react";
import { Header } from "./header";
import { Sidebar } from "./sidebar";
import { AuthGuard, LoginGuard } from "@/contexts";
export function ConditionalLayout({ children }: PropsWithChildren) {
const pathname = usePathname();
const isAuthPage = pathname.startsWith("/auth");
return (
<>
{isAuthPage ? (
<LoginGuard>
<main>{children}</main>
</LoginGuard>
) : (
<AuthGuard>
<div className="flex min-h-screen">
<Sidebar />
<div className="w-full bg-gray-2 dark:bg-[#020d1a]">
<Header />
<main className="isolate mx-auto w-full max-w-screen-2xl overflow-hidden p-4 md:p-6 2xl:p-10">
{children}
</main>
</div>
</div>
</AuthGuard>
)}
</>
);
}