#![allow(dead_code, unused_variables)] use ratatui::crossterm::event::{Event, KeyEvent, MouseEvent}; pub enum Action { Noop, Quit, Pass, // Pass input to another component. } pub trait Component { fn handle_event(&mut self, event: Event) -> Action { match event { Event::Key(key_event) => self.handle_key_events(key_event), _ => Action::Noop, } } fn handle_key_events(&mut self, key: KeyEvent) -> Action { Action::Noop } fn handle_mouse_events(&mut self, mouse: MouseEvent) -> Action { Action::Noop } fn update(&mut self, action: Action) -> Action { Action::Noop } }