mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 19:23:42 +08:00
25 lines
673 B
TypeScript
25 lines
673 B
TypeScript
const SOURCE_LABELS: Record<string, string> = {
|
|
web: 'Web',
|
|
feishu: '飞书',
|
|
dingtalk: '钉钉',
|
|
telegram: 'Telegram',
|
|
discord: 'Discord',
|
|
wecom: '企业微信',
|
|
weixin: '微信',
|
|
qq: 'QQ',
|
|
slack: 'Slack',
|
|
cron: '定时任务',
|
|
}
|
|
|
|
const ICON_CHANNELS = ['web', 'feishu', 'dingtalk', 'telegram', 'discord', 'wecom', 'weixin', 'qq', 'slack', 'cron']
|
|
|
|
export function channelIconUrl(source?: string): string {
|
|
const key = source || 'web'
|
|
if (ICON_CHANNELS.includes(key)) return `/icons/channels/${key}.svg`
|
|
return '/icons/channels/web.svg'
|
|
}
|
|
|
|
export function sourceLabel(source?: string): string {
|
|
return SOURCE_LABELS[source || 'web'] || 'Web'
|
|
}
|