// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0 // The entry page: the organizations this user belongs to, or the way in (spec §7). import { meGet } from "@conusai-kit/tenancy" import type { ReactElement } from "react" import { orFallback } from "../src/server/guard" import { pageContext } from "../src/server/page" export const dynamic = "force-dynamic" export default async function Home(): Promise { const { caller, signedIn, i18n, path } = await pageContext() if (!signedIn) { return (

{i18n.message("app.title")}

{i18n.message("app.needsSignIn")}

{i18n.message("app.signIn")}
) } // The typed in-process client: the contract decides the input and the output types, and the // same procedure answers a browser, a CLI and a partner (spec §6.2). const me = await orFallback(path, () => caller.call(meGet, undefined)) return (

{i18n.message("app.organizations")}

{me.organizations.length === 0 ? (

{i18n.message("app.noOrganizations")}

) : ( )} {i18n.message("app.createOrganization")}
) }