2023-04-18 19:33:44 -05:00
|
|
|
use std::collections::HashMap;
|
2023-04-13 12:51:25 -05:00
|
|
|
use crate::void_app::{Element, Props};
|
2023-04-16 21:46:10 -05:00
|
|
|
use super::user_prefs::UserPrefs;
|
|
|
|
|
2023-04-13 12:51:25 -05:00
|
|
|
#[derive(PartialEq, Props)]
|
|
|
|
pub struct PoemRequest {
|
|
|
|
pub slug: String,
|
2023-04-16 21:46:10 -05:00
|
|
|
pub user_prefs: UserPrefs,
|
2023-04-13 12:51:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Props)]
|
|
|
|
pub struct TitleProps {
|
|
|
|
pub title: String,
|
|
|
|
pub is_html: bool,
|
2023-04-16 21:46:10 -05:00
|
|
|
pub user_prefs: UserPrefs,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Props)]
|
|
|
|
pub struct ContentProps {
|
|
|
|
pub content: String,
|
2023-04-17 18:04:18 -05:00
|
|
|
pub user_prefs: UserPrefs,
|
2023-04-13 12:51:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Props)]
|
|
|
|
pub struct ButtonProps {
|
|
|
|
pub title: String,
|
|
|
|
pub slug: String,
|
2023-04-17 18:04:18 -05:00
|
|
|
pub user_prefs: UserPrefs,
|
2023-04-18 20:18:24 -05:00
|
|
|
pub override_font: Option<String>,
|
2023-04-13 12:51:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Props)]
|
2023-04-18 19:33:44 -05:00
|
|
|
pub struct VoidProps {
|
2023-04-13 12:51:25 -05:00
|
|
|
pub slug: Option<String>,
|
2023-04-18 19:33:44 -05:00
|
|
|
pub poem_database: PoemDatabase,
|
2023-04-17 18:04:18 -05:00
|
|
|
pub user_prefs: UserPrefs,
|
2023-04-13 12:51:25 -05:00
|
|
|
}
|
|
|
|
|
2023-04-18 19:33:44 -05:00
|
|
|
#[derive(PartialEq, Props, Clone, Debug)]
|
|
|
|
pub struct PoemDatabase {
|
|
|
|
pub poem_list: Vec<(String, String)>,
|
|
|
|
pub poem_hashmap: HashMap<String, PoemStruct>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(PartialEq, Clone, Debug)]
|
|
|
|
pub struct PoemStruct {
|
|
|
|
pub title: String,
|
|
|
|
pub content: String,
|
|
|
|
pub creation_date: String,
|
|
|
|
}
|
|
|
|
|
2023-04-16 21:46:10 -05:00
|
|
|
// These next three should all just be one prop.
|
2023-04-13 12:51:25 -05:00
|
|
|
#[derive(Props)]
|
|
|
|
pub struct PoemChildren<'a> {
|
|
|
|
pub children: Element<'a>,
|
|
|
|
}
|
2023-04-16 21:46:10 -05:00
|
|
|
|
|
|
|
#[derive(Props)]
|
|
|
|
pub struct PageChildren<'a> {
|
|
|
|
pub children: Element<'a>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Props)]
|
|
|
|
pub struct ContentChildren<'a> {
|
|
|
|
pub children: Element<'a>,
|
2023-04-18 19:33:44 -05:00
|
|
|
}
|