// SPDX-FileCopyrightText: 2026 Progmasoft // SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1 import type { ReactNode } from "react"; import { getCredentialsMessages } from "@/lib/credentials-messages"; import { siteOrigin, type OAuthSite } from "@/lib/hosts.server"; import { getMessages, type Locale } from "@/lib/localization"; import { Brand } from "../Brand"; import { PreferenceControls } from "../PreferenceControls"; interface CredentialsShellProps { children: ReactNode; eyebrow: string; title: string; description?: string; locale: Locale; /** authorize.progmasoft.com (sign-in, consent) or console.progmasoft.com (tokens). */ site: OAuthSite; /** * `split` puts the introduction beside a panel, as the account sign-in * does; `column` stacks a heading above the content of a console page. */ layout?: "split" | "column"; } /** * The frame of every page of Progmasoft OAuth and the Progmasoft Console. Its * addresses are the public ones of each host; the proxy maps them to the * internal `/authorize`, `/issuer` and `/console` trees. */ export async function CredentialsShell({ children, eyebrow, title, description, locale, site, layout = "column", }: CredentialsShellProps) { const { navigation } = getMessages(locale); const { common } = getCredentialsMessages(locale); const authorizeOrigin = site === "authorize" ? "" : await siteOrigin("authorize"); const consoleOrigin = site === "console" ? "" : await siteOrigin("console"); const heading = ( <>

{eyebrow}

{title}

{description &&

{description}

} ); return (
{layout === "split" ? (
{heading}
{children}
) : (
{heading}
{children}
)}
); }