feat: add adapter documentation link button

Add 'View Docs' button that links to the corresponding adapter's
documentation page via link.langbot.app short links.

Appears in:
- Wizard adapter selection cards (Step 0)
- Wizard bot config card header (Step 1)
- Bot create/edit form (adapter config section)

Supports all 7 languages (en/zh-Hans/zh-Hant/ja/th/vi/es).
Doc links auto-resolve to the correct language based on UI locale.
This commit is contained in:
RockChinQ
2026-03-30 16:06:54 +08:00
parent 6bf6deaefd
commit 921d12f596
10 changed files with 124 additions and 5 deletions
@@ -0,0 +1,43 @@
/**
* Returns the documentation URL for a given adapter name,
* using link.langbot.app short links.
*/
export function getAdapterDocUrl(
adapterName: string,
locale: string,
): string | null {
// Map locale to doc language prefix
let lang: string;
if (locale.startsWith('zh')) {
lang = 'zh';
} else if (locale.startsWith('ja')) {
lang = 'ja';
} else {
lang = 'en';
}
// Only adapters with dedicated doc pages
const ADAPTER_DOC_SLUGS: Record<string, string> = {
telegram: 'telegram',
discord: 'discord',
slack: 'slack',
line: 'line',
kook: 'kook',
lark: 'lark',
dingtalk: 'dingtalk',
aiocqhttp: 'aiocqhttp',
qqofficial: 'qqofficial',
wecom: 'wecom',
wecomcs: 'wecomcs',
wecombot: 'wecombot',
officialaccount: 'officialaccount',
wechatpad: 'wechatpad',
openclaw_weixin: 'openclaw_weixin',
satori: 'satori',
};
const slug = ADAPTER_DOC_SLUGS[adapterName];
if (!slug) return null;
return `https://link.langbot.app/${lang}/platforms/${slug}`;
}