{t("readyDescription")}
- + {(() => { + // Prefer deep-linking straight to the tenant page, where the + // ConnectPanel shows how to start chatting. Fall back to a + // reload only if we somehow don't have a tenant name yet. + const tenantName = data.tenant?.name || data.request.tenantName; + return tenantName ? ( + + {t("connectCta")} + + ) : ( + + ); + })()} ); diff --git a/src/components/tenants/connect-panel.tsx b/src/components/tenants/connect-panel.tsx new file mode 100644 index 0000000..1b70328 --- /dev/null +++ b/src/components/tenants/connect-panel.tsx @@ -0,0 +1,149 @@ +"use client"; + +import { useTranslations } from "next-intl"; +import { THREEMA_GATEWAY } from "@/lib/threema-gateway-config"; + +/** + * ConnectPanel + * + * The portal is a *management* console — config, billing, usage — but + * the assistant itself lives in the customer's messaging app. Nothing + * previously told the customer how to actually start talking to the + * thing they just provisioned ("Your assistant is ready… now what?"). + * + * This panel closes that gap on the tenant-detail page: for each + * enabled channel it shows the concrete first-contact steps, and when + * NO channel is enabled it says so explicitly (a running assistant with + * no channel is unreachable). + * + * It is intentionally complementary to ChannelUsers below it: + * - ConnectPanel → "how do *I* reach the assistant" + * - ChannelUsers → "*who* is allowed to reach it" + * The Threema/Telegram/Discord steps reference the authorised-users + * list rather than duplicating it. + */ + +// Render order is fixed (not the order packages happen to appear in +// spec.packages) so the panel layout is stable across tenants. +const CHANNEL_ORDER = ["threema", "telegram", "discord"] as const; + +const CHANNEL_NAMES: Record+ {t("noChannelsBody")} +
++ {t("description")} +
+ + {!ready && ( ++ {t("notReadyNote")} +
+ )} + ++ {t(CHANNEL_STEPS_KEY[c])} +
+ )} +