66 lines
1.3 KiB
Rust
66 lines
1.3 KiB
Rust
use std::collections::HashMap;
|
|
use crate::void_app::{Element, Props};
|
|
use super::user_prefs::UserPrefs;
|
|
|
|
#[derive(PartialEq, Props)]
|
|
pub struct PoemRequest {
|
|
pub slug: String,
|
|
pub user_prefs: UserPrefs,
|
|
}
|
|
|
|
#[derive(PartialEq, Props)]
|
|
pub struct TitleProps {
|
|
pub title: String,
|
|
pub is_html: bool,
|
|
pub user_prefs: UserPrefs,
|
|
}
|
|
|
|
#[derive(PartialEq, Props)]
|
|
pub struct ContentProps {
|
|
pub content: String,
|
|
pub user_prefs: UserPrefs,
|
|
}
|
|
|
|
#[derive(PartialEq, Props)]
|
|
pub struct ButtonProps {
|
|
pub title: String,
|
|
pub slug: String,
|
|
pub user_prefs: UserPrefs,
|
|
pub override_font: Option<String>,
|
|
}
|
|
|
|
#[derive(PartialEq, Props)]
|
|
pub struct VoidProps {
|
|
pub slug: Option<String>,
|
|
pub poem_database: PoemDatabase,
|
|
pub user_prefs: UserPrefs,
|
|
}
|
|
|
|
#[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,
|
|
}
|
|
|
|
// These next three should all just be one prop.
|
|
#[derive(Props)]
|
|
pub struct PoemChildren<'a> {
|
|
pub children: Element<'a>,
|
|
}
|
|
|
|
#[derive(Props)]
|
|
pub struct PageChildren<'a> {
|
|
pub children: Element<'a>,
|
|
}
|
|
|
|
#[derive(Props)]
|
|
pub struct ContentChildren<'a> {
|
|
pub children: Element<'a>,
|
|
}
|