use crossterm::event::{KeyCode, KeyEvent};
use crate::app::App;
pub fn handle_key(app: &mut App, key: KeyEvent) {
match key.code {
KeyCode::Char('t') | KeyCode::Down | KeyCode::Char('j') => {
app.cycle_theme_next();
app.save_theme();
}
KeyCode::Char('T') | KeyCode::Up | KeyCode::Char('k') => {
app.cycle_theme_prev();
app.save_theme();
}
KeyCode::Esc => {
app.show_theme_panel = false;
}
KeyCode::Enter => {
app.show_theme_panel = false;
}
_ => {}
}
}