use std::error::Error; use crate::{ app::app::App, structs::{Item, WatchHistory}, }; use crossterm::event::KeyCode; use tui::{backend::Backend, layout::Rect, Frame}; pub trait ItemTrait { fn key_input(&mut self, key: KeyCode, app: App) -> (bool, App); fn render_item( &self, frame: &mut Frame, rect: Rect, app: App, selected: bool, hover: bool, popup_focus: bool, popup_render: bool, ) -> (bool, Option, App); fn select(&mut self, app: App) -> (App, bool); fn selectable(&self) -> bool; fn load_item( &self, app: &App, watch_history: &mut WatchHistory, ) -> Result>; }