import ThemeSwitcher from "@app/components/ThemeSwitcher"; import { Separator } from "@app/components/ui/separator"; import { priv } from "@app/lib/api"; import { pullEnv } from "@app/lib/pullEnv"; import { build } from "@server/build"; import { GetLicenseStatusResponse } from "@server/routers/license/types"; import { AxiosResponse } from "axios"; import { Metadata } from "next"; import { getTranslations } from "next-intl/server"; import { cache } from "react"; export const metadata: Metadata = { title: `Auth - ${process.env.BRANDING_APP_NAME || "Pangolin"}`, description: "" }; type AuthLayoutProps = { children: React.ReactNode; }; export default async function AuthLayout({ children }: AuthLayoutProps) { const env = pullEnv(); const t = await getTranslations(); let hideFooter = false; let licenseStatus: GetLicenseStatusResponse | null = null; if (build == "enterprise") { const licenseStatusRes = await cache( async () => await priv.get>( "/license/status" ) )(); licenseStatus = licenseStatusRes.data.data; if ( env.branding.hideAuthLayoutFooter && licenseStatusRes.data.data.isHostLicensed && licenseStatusRes.data.data.isLicenseValid && licenseStatusRes.data.data.tier !== "personal" ) { hideFooter = true; } } return (
{children}
{!hideFooter && ( )}
); }