Commit 2737f15310

2737f153106b44565bbbab1d0b08ab3067071283

parent: 46e7ed5b32

Unsigned

Siriusmart <71584876+Siriusmart@users.noreply.github.com> · 2022-05-30 17:13 UTC

Support for search (Currently only supports videos and filters out all other results)

Layout: unified · split

Cargo.toml +1 −1
@@ -29,4 +29,4 @@ serde_yaml = "0.8"
2929serde_json = "1"
3030
3131[profile.dev.package."*"]
32opt-level = 3
32opt-level = 3
\ No newline at end of file
README.md +3 −3
@@ -1,9 +1,9 @@
11## Warning:
2* This app is incomplete and is missing many features
2* This app is incomplete but is basically usable
33* This app is only for *\*nix* systems
44
55## Changes made in this commit
6* Added search filters
6* Search support for video (Cannot display channel and playlists yet)
77
88## Installation
99Requirements: Git, Cargo and the Rust Compiler
@@ -95,7 +95,7 @@ The config files are located in `~/.config/youtube-tui`, run the program once to
9595>
9696
9797## To Do
98* Search
98* Search (For all items)
9999* Adaptive config files (auto update when config files when there are new options in the config)
100100
101101## Bugs
src/app/app.rs +34 −1
@@ -18,7 +18,10 @@ use tui::{
1818 Frame,
1919};
2020
21use super::{config::Config, pages::item_info::ItemInfo};
21use super::{
22 config::Config,
23 pages::{item_info::ItemInfo, search::Search},
24};
2225
2326#[derive(Debug)]
2427pub struct App {
@@ -36,6 +39,8 @@ pub struct App {
3639 pub history: Vec<AppHistory>,
3740 pub watch_history: WatchHistory,
3841 pub search_settings: SearchSettings,
42 pub search_text: String,
43 pub page_no: usize,
3944}
4045
4146impl Default for App {
@@ -57,6 +62,8 @@ impl Default for App {
5762 config: Config::load().unwrap(),
5863 watch_history: WatchHistory::load(),
5964 search_settings: SearchSettings::default(),
65 search_text: String::new(),
66 page_no: 1,
6067 }
6168 }
6269}
@@ -72,6 +79,7 @@ impl App {
7279 Item::Global(item) => item.selectable(),
7380 Item::MainMenu(item) => item.selectable(),
7481 Item::ItemInfo(item) => item.selectable(),
82 Item::Search(item) => item.selectable(),
7583 } {
7684 row_vec.push((x, y));
7785 }
@@ -112,6 +120,14 @@ impl App {
112120 self.state[y].items[x].item = Item::ItemInfo(item);
113121 }
114122 }
123 Item::Search(item) => {
124 let mut item = item.clone();
125 let hold = item.key_input(key, self);
126 self = hold.1;
127 if hold.0 {
128 self.state[y].items[x].item = Item::Search(item);
129 }
130 }
115131 }
116132
117133 return self;
@@ -153,6 +169,13 @@ impl App {
153169 self.selected = Some((x, y));
154170 }
155171 }
172 Item::Search(mut item) => {
173 let held = item.select(self);
174 self = held.0;
175 if held.1 {
176 self.selected = Some((x, y));
177 }
178 }
156179 }
157180
158181 return self;
@@ -236,6 +259,7 @@ impl App {
236259 let min = match self.page {
237260 Page::MainMenu(_) => MainMenu::min(),
238261 Page::ItemDisplay(_) => ItemInfo::min(),
262 Page::Search => Search::min(),
239263 };
240264
241265 if size.width < min.0 || size.height < min.1 {
@@ -324,6 +348,7 @@ impl App {
324348 false,
325349 &*self.message.lock().unwrap(),
326350 &mut self.search_settings,
351 &self.search_text,
327352 ),
328353 Item::MainMenu(i) => {
329354 i.render_item(frame, chunk, selected, hover, self.popup_focus, &self.page);
@@ -334,6 +359,11 @@ impl App {
334359 i.render_item(frame, chunk, selected, hover, self.popup_focus);
335360 false
336361 }
362
363 Item::Search(i) => {
364 i.render_item(frame, chunk, selected, hover, self.popup_focus);
365 false
366 }
337367 } {
338368 popups.push((item, selected, hover, chunk));
339369 }
@@ -351,6 +381,7 @@ impl App {
351381 true,
352382 &*self.message.lock().unwrap(),
353383 &mut self.search_settings,
384 &self.search_text,
354385 );
355386 }
356387 _ => {} // Item::MainMenu(i) => {
@@ -387,6 +418,8 @@ impl App {
387418 watch_history: self.watch_history,
388419 search_settings: self.search_settings,
389420 popup_focus: app_history.popup_focus,
421 search_text: app_history.search_text,
422 page_no: app_history.page_no,
390423 };
391424
392425 (self, true)
src/app/pages/global.rs +33 −10
@@ -12,14 +12,16 @@ use tui::{
1212use crate::{
1313 app::app::App,
1414 functions::center_rect,
15 structs::SearchSettings,
15 structs::{SearchSettings, Page},
1616 traits::{KeyInput, SelectItem},
1717 widgets::{force_clear::ForceClear, horizontal_split::HorizontalSplit},
1818};
1919
20use super::search::Search;
21
2022#[derive(Debug, Clone)]
2123pub enum GlobalItem {
22 SearchBar(String),
24 SearchBar,
2325 SearchSettings,
2426 MessageBar,
2527}
@@ -51,7 +53,7 @@ impl Mode {
5153impl SelectItem for GlobalItem {
5254 fn select(&mut self, mut app: App) -> (App, bool) {
5355 let selected = match self {
54 GlobalItem::SearchBar(_) => true,
56 GlobalItem::SearchBar => true,
5557 GlobalItem::SearchSettings => {
5658 app.popup_focus = true;
5759 true
@@ -64,7 +66,7 @@ impl SelectItem for GlobalItem {
6466
6567 fn selectable(&self) -> bool {
6668 match self {
67 GlobalItem::SearchBar(_) | GlobalItem::SearchSettings => true,
69 GlobalItem::SearchBar | GlobalItem::SearchSettings => true,
6870 _ => false,
6971 }
7072 }
@@ -73,14 +75,34 @@ impl SelectItem for GlobalItem {
7375impl KeyInput for GlobalItem {
7476 fn key_input(&mut self, key: KeyCode, mut app: App) -> (bool, App) {
7577 match self {
76 GlobalItem::SearchBar(search_bar) => match key {
78 GlobalItem::SearchBar => match key {
7779 KeyCode::Char(c) => {
78 search_bar.push(c);
80 app.search_text.push(c);
7981 }
8082 KeyCode::Backspace => {
81 search_bar.pop();
83 app.search_text.pop();
84 }
85 KeyCode::Enter => {
86 let state = Search::default();
87 let mut history = app.history.clone();
88 let search_text = app.search_text.clone();
89 let search_settings = app.search_settings.clone();
90 history.push(app.into());
91
92 return (
93 false,
94 App {
95 history,
96 page: Page::Search,
97 selectable: App::selectable(&state),
98 state,
99 search_text,
100 search_settings,
101 load: true,
102 ..Default::default()
103 },
104 );
82105 }
83 KeyCode::Enter => {}
84106 _ => {}
85107 },
86108 GlobalItem::SearchSettings => {
@@ -103,10 +125,11 @@ impl GlobalItem {
103125 popup_render: bool,
104126 message: &Option<String>,
105127 search_settings: &mut SearchSettings,
128 search_text: &String,
106129 ) -> bool {
107130 let area = frame.size();
108131 match self {
109 GlobalItem::SearchBar(search) => {
132 GlobalItem::SearchBar => {
110133 let block = Block::default()
111134 .border_type(BorderType::Rounded)
112135 .borders(Borders::ALL)
@@ -119,7 +142,7 @@ impl GlobalItem {
119142 }))
120143 .title("Search YouTube")
121144 .title_alignment(Alignment::Center);
122 let paragraph = Paragraph::new(search.clone()).block(block);
145 let paragraph = Paragraph::new(search_text.clone()).block(block);
123146 frame.render_widget(paragraph, rect);
124147 }
125148 GlobalItem::MessageBar => {
src/app/pages/item_info.rs +1 −1
@@ -383,7 +383,7 @@ impl ItemInfo {
383383 vec![
384384 Row {
385385 items: vec![RowItem {
386 item: Item::Global(GlobalItem::SearchBar(String::new())),
386 item: Item::Global(GlobalItem::SearchBar),
387387 constraint: Constraint::Percentage(100),
388388 }],
389389 centered: false,
src/app/pages/main_menu.rs +4 −20
@@ -171,10 +171,7 @@ impl LoadItem for MainMenuItem {
171171 if let Ok(file) = file {
172172 let item: ListItem = serde_json::from_str(&file).unwrap();
173173
174 let title = match &item {
175 ListItem::FullVideo(v) => v.title.clone(),
176 _ => unreachable!(),
177 };
174 let title = item.to_string();
178175
179176 list.push_back(item);
180177 text_list.items.push(title);
@@ -271,21 +268,8 @@ impl MainMenuItem {
271268 }
272269}
273270
274fn textlist_from_video_list(original: &LinkedList<ListItem>) -> Vec<String> {
275 original
276 .iter()
277 .map(|item| match item {
278 ListItem::MiniVideo(video) => video
279 .title
280 .clone()
281 .chars()
282 .map(|c| if c.is_ascii() { c } else { '?' })
283 .collect(),
284 _ => {
285 unreachable!()
286 }
287 })
288 .collect()
271pub fn textlist_from_video_list(original: &LinkedList<ListItem>) -> Vec<String> {
272 original.iter().map(|item| item.to_string()).collect()
289273}
290274
291275#[derive(Debug, Clone, Copy, PartialEq)]
@@ -317,7 +301,7 @@ impl MainMenu {
317301 Row {
318302 items: vec![
319303 RowItem {
320 item: Item::Global(GlobalItem::SearchBar(String::new())),
304 item: Item::Global(GlobalItem::SearchBar),
321305 constraint: Constraint::Min(16),
322306 },
323307 RowItem {
src/app/pages/mod.rs +1
@@ -1,3 +1,4 @@
11pub mod global;
22pub mod item_info;
33pub mod main_menu;
4pub mod search;
\ No newline at end of file
src/app/pages/search.rs added +308
@@ -0,0 +1,308 @@
1use std::collections::LinkedList;
2
3use crossterm::event::KeyCode;
4use invidious::structs::hidden::SearchItem as InvidiousSearchItem;
5use tui::{
6 backend::Backend,
7 layout::{Constraint, Rect},
8 style::{Color, Style},
9 Frame,
10};
11
12use crate::{
13 app::app::App,
14 functions::download_all_thumbnails,
15 structs::{Item, ListItem, MiniVideo, Page, Row, RowItem},
16 traits::{KeyInput, LoadItem, SelectItem},
17 widgets::{horizontal_split::HorizontalSplit, item_display::ItemDisplay, text_list::TextList},
18};
19
20use super::{
21 global::GlobalItem,
22 item_info::{DisplayItem, ItemInfo},
23 main_menu::textlist_from_video_list,
24};
25
26#[derive(Debug, Clone)]
27pub enum SearchItem {
28 Search {
29 results: Option<LinkedList<ListItem>>,
30 text_list: TextList,
31 },
32}
33
34impl SelectItem for SearchItem {
35 fn select(&mut self, app: App) -> (App, bool) {
36 (app, true)
37 }
38
39 fn selectable(&self) -> bool {
40 true
41 }
42}
43
44impl KeyInput for SearchItem {
45 fn key_input(&mut self, key: KeyCode, app: App) -> (bool, App) {
46 match self {
47 SearchItem::Search { results, text_list } => match key {
48 KeyCode::Up => text_list.up(),
49 KeyCode::Down => text_list.down(),
50 KeyCode::PageUp => text_list.selected = 0,
51 KeyCode::PageDown => text_list.selected = text_list.items.len() - 1,
52 KeyCode::Enter => {
53 if let Some(results_unwrapped) = results {
54 match results_unwrapped.iter().nth(text_list.selected).unwrap() {
55 ListItem::PageTurner(b) => {
56 let new_page_no;
57 if *b {
58 new_page_no = app.page_no + 1;
59 } else {
60 new_page_no = app.page_no - 1;
61 }
62
63 *results = None;
64 *text_list = TextList::default();
65
66 let state = Search::default();
67 let mut history = app.history.clone();
68 let search_text = app.search_text.clone();
69 let search_settings = app.search_settings.clone();
70 history.push(app.into());
71
72 return (
73 false,
74 App {
75 history,
76 page: Page::Search,
77 selectable: App::selectable(&state),
78 state,
79 search_text,
80 search_settings,
81 load: true,
82 page_no: new_page_no,
83 ..Default::default()
84 },
85 );
86 }
87
88 ListItem::MiniVideo(video) => {
89 let state = ItemInfo::default();
90 let mut history = app.history.clone();
91 history.push(app.into());
92
93 return (
94 false,
95 App {
96 history,
97 page: Page::ItemDisplay(DisplayItem::Video(
98 video.video_id.clone(),
99 )),
100 selectable: App::selectable(&state),
101 state,
102 ..Default::default()
103 },
104 );
105 }
106
107 _ => {}
108 }
109 }
110 }
111 _ => {}
112 },
113 }
114
115 (true, app)
116 }
117}
118
119impl LoadItem for SearchItem {
120 fn load_item(&self, app: &App) -> Result<Box<Self>, Box<dyn std::error::Error>> {
121 let mut this = self.clone();
122
123 match &mut this {
124 SearchItem::Search { results, text_list } => {
125 // panic!("got here");
126 if app.search_text.len() == 0 {
127 *app.message.lock().unwrap() =
128 Some(String::from("Search term cannot be empty"));
129 } else {
130 let mut args = vec![app.search_text.clone()];
131 args.extend(app.search_settings.clone().to_vec());
132
133 let invidious_results = app
134 .client
135 .search(Some(&format!(
136 "page={}&q={}",
137 app.page_no,
138 args.join("&").as_str()
139 )))?
140 .items;
141
142 let mut items = LinkedList::new();
143
144 for item in invidious_results {
145 match item {
146 InvidiousSearchItem::Video {
147 title: _,
148 videoId: _,
149 author: _,
150 authorId: _,
151 authorUrl: _,
152 lengthSeconds: _,
153 videoThumbnails: _,
154 description: _,
155 descriptionHtml: _,
156 viewCount: _,
157 published: _,
158 publishedText: _,
159 liveNow: _,
160 paid: _,
161 premium: _,
162 } => {
163 items.push_back(ListItem::MiniVideo(MiniVideo::from(item)));
164 }
165
166 _ => {}
167 }
168 }
169
170 let mut minimum_length = 0;
171
172 if app.page_no != 1 {
173 minimum_length += 1;
174 items.push_front(ListItem::PageTurner(false));
175 }
176
177 if items.len() == minimum_length {
178 *app.message.lock().unwrap() = Some(String::from("No results found"));
179 } else {
180 items.push_back(ListItem::PageTurner(true));
181 }
182
183 text_list.items = textlist_from_video_list(&items);
184
185 let mut thumbnails = LinkedList::new();
186
187 for item in items.iter() {
188 match item {
189 ListItem::MiniVideo(video) => {
190 thumbnails.push_back((
191 video.video_thumbnail.clone(),
192 video.video_id.clone(),
193 ));
194 }
195
196 _ => {}
197 }
198 }
199
200 let _ = download_all_thumbnails(thumbnails);
201
202 *results = Some(items);
203 }
204 }
205 }
206
207 Ok(Box::new(this))
208 }
209}
210
211impl SearchItem {
212 pub fn render_item<B: Backend>(
213 &mut self,
214 frame: &mut Frame<B>,
215 rect: Rect,
216 selected: bool,
217 hover: bool,
218 popup_focus: bool,
219 ) {
220
221 match self {
222 SearchItem::Search { results, text_list } => {
223 let split = HorizontalSplit::default()
224 .percentages(vec![60, 40])
225 .border_style(Style::default().fg(if selected {
226 Color::LightBlue
227 } else if hover {
228 Color::LightRed
229 } else {
230 Color::Reset
231 }));
232
233 let chunks = split.inner(rect);
234
235 frame.render_widget(split, rect);
236
237 text_list.area(chunks[0]);
238 let mut text_list = text_list.clone();
239
240 if let Some(result) = results {
241 if let Some(item) = result.iter().nth(text_list.selected) {
242 if !popup_focus {
243 frame.render_widget(ItemDisplay { item: item.clone() }, chunks[1]);
244 }
245 }
246 }
247
248 if selected {
249 text_list.selected_style(Style::default().fg(Color::LightRed));
250 } else {
251 text_list.selected_style(Style::default().fg(Color::LightYellow));
252 }
253
254 frame.render_widget(text_list, chunks[0]);
255 }
256 }
257 }
258}
259
260pub struct Search;
261
262impl Search {
263 pub fn message() -> String {
264 String::from("Loading search results...")
265 }
266
267 pub fn min() -> (u16, u16) {
268 (45, 12)
269 }
270
271 pub fn default() -> Vec<Row> {
272 vec![
273 Row {
274 items: vec![
275 RowItem {
276 item: Item::Global(GlobalItem::SearchBar),
277 constraint: Constraint::Min(16),
278 },
279 RowItem {
280 item: Item::Global(GlobalItem::SearchSettings),
281 constraint: Constraint::Length(5),
282 },
283 ],
284 centered: false,
285 height: Constraint::Length(3),
286 },
287 Row {
288 items: vec![RowItem {
289 item: Item::Search(SearchItem::Search {
290 results: None,
291 text_list: TextList::default(),
292 }),
293 constraint: Constraint::Percentage(100),
294 }],
295 centered: false,
296 height: Constraint::Min(6),
297 },
298 Row {
299 items: vec![RowItem {
300 item: Item::Global(GlobalItem::MessageBar),
301 constraint: Constraint::Percentage(100),
302 }],
303 centered: false,
304 height: Constraint::Length(3),
305 },
306 ]
307 }
308}
src/functions/download_all_thumbnails.rs +1 −1
@@ -9,7 +9,7 @@ pub enum ItemType {
99}
1010
1111pub fn download_all_thumbnails(
12 list: LinkedList<(String, String)>,
12 list: LinkedList<(String, String)>, // (url, id)
1313) -> Result<(), Box<dyn Error>> {
1414 thread::spawn(move || {
1515 let rt: Runtime = tokio::runtime::Runtime::new().unwrap();
src/main.rs +17 −1
@@ -11,7 +11,7 @@ use tui::{
1111use youtube_tui::{
1212 app::{
1313 app::App,
14 pages::{item_info::ItemInfo, main_menu::MainMenu},
14 pages::{item_info::ItemInfo, main_menu::MainMenu, search::Search},
1515 },
1616 structs::{Item, Page, Row, RowItem},
1717 traits::LoadItem,
@@ -53,6 +53,7 @@ fn run_app<B: Backend>(mut terminal: &mut Terminal<B>, mut app: App) -> Result<(
5353 *app.message.lock().unwrap() = Some(match app.page {
5454 Page::MainMenu(_) => MainMenu::message(),
5555 Page::ItemDisplay(_) => ItemInfo::message(),
56 Page::Search => Search::message(),
5657 });
5758 terminal.clear()?;
5859 ui(&mut terminal, &mut app)?;
@@ -91,6 +92,21 @@ fn run_app<B: Backend>(mut terminal: &mut Terminal<B>, mut app: App) -> Result<(
9192 *app.message.lock().unwrap() = Some(e.to_string());
9293 }
9394 },
95 Item::Search(item) => match item.load_item(&app) {
96 Ok(new) => {
97 row_vec.push(RowItem {
98 item: Item::Search(*new),
99 ..*row_item
100 });
101 }
102 Err(e) => {
103 row_vec.push(RowItem {
104 item: Item::Search(item.clone()),
105 ..*row_item
106 });
107 *app.message.lock().unwrap() = Some(e.to_string());
108 }
109 },
94110 _ => {
95111 row_vec.push(RowItem {
96112 item: row_item.item.clone(),
src/structs/apphistory.rs +8
@@ -7,6 +7,8 @@ use crate::{
77 structs::{Page, Row},
88};
99
10use super::SearchSettings;
11
1012#[derive(Debug, Clone)]
1113pub struct AppHistory {
1214 pub page: Page,
@@ -19,6 +21,9 @@ pub struct AppHistory {
1921 pub load: bool,
2022 pub render: bool,
2123 pub popup_focus: bool,
24 pub search_text: String,
25 pub search_settings: SearchSettings,
26 pub page_no: usize,
2227}
2328
2429impl From<App> for AppHistory {
@@ -34,6 +39,9 @@ impl From<App> for AppHistory {
3439 load: original.load,
3540 render: original.render,
3641 popup_focus: original.popup_focus,
42 search_text: original.search_text,
43 search_settings: original.search_settings,
44 page_no: original.page_no,
3745 }
3846 }
3947}
src/structs/listitem.rs +31
@@ -18,4 +18,35 @@ impl ListItem {
1818 }
1919 }
2020 }
21
22 pub fn is_page_turner(&self) -> bool {
23 match self {
24 ListItem::PageTurner(_) => true,
25 _ => false,
26 }
27 }
28
29 pub fn to_string(&self) -> String {
30 match self {
31 ListItem::MiniVideo(video) => video
32 .title
33 .chars()
34 .into_iter()
35 .filter(|c| !c.is_ascii_control())
36 .collect(),
37 ListItem::FullVideo(video) => video
38 .title
39 .chars()
40 .into_iter()
41 .filter(|c| !c.is_ascii_control())
42 .collect(),
43 ListItem::PageTurner(turner) => {
44 if *turner {
45 String::from("Next Page")
46 } else {
47 String::from("Previous Page")
48 }
49 }
50 }
51 }
2152}
src/structs/minivideo.rs +35 −1
@@ -1,5 +1,5 @@
11use chrono::{prelude::*, Utc};
2use invidious::structs::hidden::{PopularItem, TrendingVideo};
2use invidious::structs::hidden::{PopularItem, TrendingVideo, SearchItem};
33use thousands::Separable;
44use serde::{Deserialize, Serialize};
55
@@ -71,3 +71,37 @@ impl From<PopularItem> for MiniVideo {
7171 }
7272 }
7373}
74
75impl From<SearchItem> for MiniVideo {
76 fn from(original: SearchItem) -> Self {
77 match original {
78 SearchItem::Video { title, videoId, author, authorId: _, authorUrl, lengthSeconds, videoThumbnails, description, descriptionHtml: _, viewCount, published, publishedText, liveNow: _, paid: _, premium: _ } => {
79 MiniVideo {
80 title: title,
81 video_id: videoId,
82 video_thumbnail: videoThumbnails[0].url.clone(),
83 length: hrtime::from_sec_padded(lengthSeconds as u64),
84 view_count: viewCount.separate_with_commas(),
85 author: author,
86 author_url: authorUrl,
87 published: format!(
88 "{}{}",
89 publishedText,
90 if Utc::now().timestamp() - published as i64 > 86400 {
91 let datetime: DateTime<Utc> = DateTime::from_utc(
92 NaiveDateTime::from_timestamp(published as i64, 0),
93 Utc,
94 );
95 format!(" [{}]", datetime.format("%Y/%m/%d"))
96 } else {
97 String::new()
98 }
99 ),
100 description: description,
101 }
102 }
103
104 _ => unreachable!(),
105 }
106 }
107}
\ No newline at end of file
src/structs/page.rs +1
@@ -4,6 +4,7 @@ use crate::app::pages::{item_info::DisplayItem, main_menu::MainMenuSelector};
44pub enum Page {
55 MainMenu(MainMenuSelector),
66 ItemDisplay(DisplayItem),
7 Search,
78}
89
910impl Default for Page {
src/structs/search_settings.rs +3 −3
@@ -108,9 +108,9 @@ impl SearchSettings {
108108 *self = Self::default();
109109 self.text_list.selected = 4;
110110 self.update_left();
111 } else {
112 self.row = false;
113111 }
112
113 self.row = !self.row;
114114 }
115115 _ => {}
116116 }
@@ -159,7 +159,7 @@ pub enum SearchSettingsSortBy {
159159impl AsUrlString for SearchSettingsSortBy {
160160 fn as_url_string(&self) -> String {
161161 format!(
162 "sort_by={}",
162 "sort={}",
163163 match self {
164164 SearchSettingsSortBy::Relevance => String::from("relevance"),
165165 SearchSettingsSortBy::Rating => String::from("rating"),
src/structs/states.rs +2 −1
@@ -1,12 +1,13 @@
11use tui::layout::Constraint;
22
3use crate::app::pages::{global::GlobalItem, item_info::ItemInfoItem, main_menu::MainMenuItem};
3use crate::app::pages::{global::GlobalItem, item_info::ItemInfoItem, main_menu::MainMenuItem, search::SearchItem};
44
55#[derive(Debug, Clone)]
66pub enum Item {
77 Global(GlobalItem),
88 MainMenu(MainMenuItem),
99 ItemInfo(ItemInfoItem),
10 Search(SearchItem),
1011}
1112
1213#[derive(Debug, Clone)]