feat(voice): add async selectable summaries
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import type { FeedbackSession, VoiceAudioSegment, VoiceLesson } from '../../utils/types'
|
||||
|
||||
export type VoicePrimaryAction = 'save' | 'retry' | 'processing' | 'generate'
|
||||
export type VoicePrimaryAction = 'save' | 'retry' | 'processing'
|
||||
|
||||
export function getVoicePrimaryAction(session: FeedbackSession | null): VoicePrimaryAction {
|
||||
if (!session || session.lessonCount === 0) return 'save'
|
||||
if (session.failedSegmentCount > 0) return 'retry'
|
||||
if (session.processingSegmentCount > 0) return 'processing'
|
||||
return session.needsGeneration ? 'generate' : 'save'
|
||||
return 'save'
|
||||
}
|
||||
|
||||
export function getVoicePrimaryActionText(
|
||||
@@ -15,7 +15,6 @@ export function getVoicePrimaryActionText(
|
||||
): string {
|
||||
if (action === 'retry') return `重试转录(${failedSegmentCount})`
|
||||
if (action === 'processing') return '转录中'
|
||||
if (action === 'generate') return '生成反馈'
|
||||
return '保存反馈'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user