TorbatYar/frontend/app/admin/layout.tsx
Mortezakoohjani 800b0ba2c5 Deploy TorbatYar for torbatyar.ir with nginx multi-tenant routing.
Wire production domain, CORS for tenant subdomains, celery volume mounts, and nginx reverse proxy configs for apex, API, identity, auth, and wildcard tenants.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 21:43:33 +03:30

22 lines
637 B
TypeScript

"use client";
import { ReactNode } from "react";
import { usePathname } from "next/navigation";
import { AdminAuthGuard } from "@/components/AdminAuthGuard";
import { AdminShell } from "@/components/admin/AdminShell";
export default function AdminLayout({ children }: { children: ReactNode }) {
const pathname = usePathname();
// صفحه ورود ادمین فقط redirect است و نباید داخل shell/guard قرار گیرد.
if (pathname === "/admin/login") {
return <>{children}</>;
}
return (
<AdminAuthGuard>
<AdminShell>{children}</AdminShell>
</AdminAuthGuard>
);
}