import type { ImChannelType } from './types'

export interface ImChannelCatalogEntry {
  type: ImChannelType
  label: string
}

export const BUILTIN_IM_CHANNEL_TYPES: ImChannelType[] = [
  'telegram',
  'feishu',
  'discord',
  'weixin',
  'dingtalk',
  'wecom',
]

export const BUILTIN_IM_CHANNELS: ImChannelCatalogEntry[] = [
  { type: 'telegram', label: 'Telegram' },
  { type: 'feishu', label: 'Feishu' },
  { type: 'discord', label: 'Discord' },
  { type: 'weixin', label: 'WeChat' },
  { type: 'dingtalk', label: 'DingTalk' },
  { type: 'wecom', label: 'WeCom' },
]

export function getBuiltinImChannel(type: string): ImChannelCatalogEntry | undefined {
  return BUILTIN_IM_CHANNELS.find((entry) => entry.type === type)
}
