import type { Issue } from '../types' import { FORGE_NAMES, forgeKindForHost } from '../../../src/forge/types' /** 工单所在系统的名字,用在「在 GitHub 打开」这类文案里;代码托管工单看网页地址的 host 认是哪一家。 */ export function trackerName(issue: Pick): string { if (issue.source === 'youtrack') return 'YouTrack' let host = '' try { host = new URL(issue.htmlUrl).host } catch {} return FORGE_NAMES[forgeKindForHost(host)] }