use crate::tui::app::state::AppState;
pub fn drain_voice_transcription(state: &mut AppState) {
let slot = match &state.pending_voice_text {
Some(s) => s.clone(),
None => return,
};
let text = match slot.lock().ok().and_then(|mut g| g.take()) {
Some(t) if !t.is_empty() => t,
_ => return,
};
state.pending_voice_text = None;
state.insert_text(&text);
state.status = "Voice transcribed ✓".into();
}