Add prompt picker to audio transcribe tab

This commit is contained in:
Beingpax 2025-10-08 15:48:33 +05:45
parent febd75cc39
commit e58d178c9d

View File

@ -84,6 +84,31 @@ struct AudioTranscribeView: View {
HStack(spacing: 8) {
Text("Prompt:")
.font(.subheadline)
if enhancementService.allPrompts.isEmpty {
Text("No prompts available")
.foregroundColor(.secondary)
.italic()
.font(.caption)
} else {
let promptBinding = Binding<UUID>(
get: {
selectedPromptId ?? enhancementService.allPrompts.first?.id ?? UUID()
},
set: { newValue in
selectedPromptId = newValue
enhancementService.selectedPromptId = newValue
}
)
Picker("", selection: promptBinding) {
ForEach(enhancementService.allPrompts) { prompt in
Text(prompt.title).tag(prompt.id)
}
}
.labelsHidden()
.fixedSize()
}
}
}
}