"use client"; import { useTranslations } from "next-intl"; import { signOut, useSession } from "next-auth/react"; import { usePathname } from "@/i18n/navigation"; import { Link } from "@/i18n/navigation"; import { SessionProvider } from "next-auth/react"; import { LanguageSwitcher } from "@/components/ui/language-switcher"; function NavBar() { const t = useTranslations("common"); const { data: session } = useSession(); const pathname = usePathname(); const user = (session as any)?.platformUser; const isLogin = pathname === "/login"; if (isLogin) return null; return ( {/* Logo / brand */} {/* Geometric mark */} {t("appName")} {t("tagline")} {/* Nav links */} {t("dashboard")} {/* Slice 7: /team is owner+platform only. Match server-side gate (canMutate). The roles array carries either "owner" or "user" for customer sessions; isPlatform covers the platform side. */} {user && (user.isPlatform || (Array.isArray(user.roles) && user.roles.includes("owner"))) && ( {t("team")} )} {user?.isPlatform && ( {t("admin")} )} {/* Right side */} {user && ( {user.orgName} )} signOut({ callbackUrl: "/login" })} className="text-xs font-medium text-text-secondary hover:text-error transition-colors cursor-pointer" > {t("logout")} ); } function NavLink({ href, active, children, }: { href: string; active: boolean; children: React.ReactNode; }) { return ( {children} ); } export function NavShell({ children }: { children: React.ReactNode }) { return ( {children} ); }