task-134(记录与版本中心): 实现数字人版本状态展示
新增 digitalhuman-status-display.ts:状态文案/标签与最新徽标映射。 TDD: task-134.test.ts 8 用例 RED→GREEN。
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/** 数字人版本状态展示(任务 134):状态到文案/标签映射与最新徽标;纯逻辑。 */
|
||||
import { normalizeDigitalHumanStatus, type DigitalHumanVersionStatus } from './digitalhuman-dto.ts'
|
||||
|
||||
export function digitalHumanStatusDisplay(status: unknown): { text: string; tag: string } {
|
||||
const normalized: DigitalHumanVersionStatus = normalizeDigitalHumanStatus(status)
|
||||
return normalized === 'RELEASED' ? { text: '已发布', tag: 'success' } : { text: '草稿', tag: 'info' }
|
||||
}
|
||||
|
||||
export function latestBadgeText(isLatest: boolean): string {
|
||||
return isLatest === true ? '最新' : ''
|
||||
}
|
||||
Reference in New Issue
Block a user