Files
nanobot/nanobot/channels/feishu/webui/FeishuConnectFlow.tsx
T
chengyongru e8a29a0087 feat(webui): improve setup flows across chat channels (NAN-112) (#5356)
* feat(webui): improve channel setup flows

* fix(webui): refine channel setup interactions (NAN-112)

* fix(webui): keep email setup sections channel-owned

* fix(webui): remove concrete channel details from shared components

* refactor(webui): remove unused channel setup resources

* fix(webui): finish channel-owned setup boundaries

* fix(webui): update channel switches optimistically

* test(channels): remove obsolete absence assertions

* fix(webui): flatten channel instance settings disclosure

* fix(webui): complete channel setup and connection flows

* fix(whatsapp): wait for session database release

* fix(webui): preserve scrolling channel controls

* fix(webui): stage channel connection checks

* fix(channels): align verification actions

* fix(email): expose connection checks

* fix(webui): align channel field actions

* fix(email): verify account credentials

* fix(wecom): bypass system proxy for websocket

* fix(channels): stabilize async connection cleanup

* fix(webui): autosave channel credentials

* fix(email): make provider presets non-destructive

* test(weixin): isolate persisted QR credentials
2026-09-11 15:22:14 +08:00

49 lines
1.7 KiB
TypeScript

import { useTranslation } from "react-i18next";
import { channelTranslator } from "@/channel-plugins/i18n";
import { ChannelQrConnectFlow } from "@/components/settings/channels/ChannelQrConnectFlow";
import type { NanobotFeaturesPayload } from "@/lib/types";
export function FeishuConnectFlow({
token,
instanceId = "default",
mode = "replace",
idleLabel,
connectRequestId,
onFeaturesUpdate,
}: {
token: string;
instanceId?: string;
mode?: "replace" | "create";
idleLabel?: string;
connectRequestId?: number;
onFeaturesUpdate: (payload: NanobotFeaturesPayload) => void;
}) {
const { t } = useTranslation();
const tx = channelTranslator(t, "feishu");
return (
<ChannelQrConnectFlow
token={token}
channelName="feishu"
startParams={{ domain: "feishu", instance_id: instanceId, mode }}
idleLabel={idleLabel}
connectRequestId={connectRequestId}
onFeaturesUpdate={onFeaturesUpdate}
labels={{
qrAlt: tx("custom.qrAlt", "Feishu connection QR code"),
scanTitle: tx("custom.scanTitle", "Scan with Feishu"),
scanDescription: tx(
"custom.scanDescription",
"Use Feishu or Lark on your phone to scan this code. nanobot will finish setup automatically after authorization.",
),
waiting: tx("custom.waiting", "Waiting for authorization..."),
connected: tx("custom.connected", "Feishu is connected."),
stopped: tx("custom.stopped", "Connection stopped."),
connecting: tx("custom.connecting", "Connecting..."),
scanAgain: t("settings.channels.scanAgain", { defaultValue: "Scan again" }),
connect: t("settings.channels.connect", { defaultValue: "Connect" }),
}}
/>
);
}