use axohtml::{
dom::DOMTree,
elements::FlowContent,
html,
types::{Class, SpacedSet},
unsafe_text,
};
type Tree = Box>;
pub mod home;
pub mod inventory;
pub mod triplist;
pub use home::*;
pub use inventory::*;
pub use triplist::*;
pub struct Root {
doc: DOMTree,
}
pub enum TopLevelPage {
Inventory,
Trips,
None,
}
impl Root {
pub fn build(body: Tree, active_page: TopLevelPage) -> Self {
let active_classes: SpacedSet =
["text-lg", "font-bold", "underline"].try_into().unwrap();
let inactive_classes: SpacedSet = ["text-lg"].try_into().unwrap();
let doc = html!(
"Packager"
{body}
);
Self { doc }
}
pub fn to_string(&self) -> String {
let mut doc = self.doc.to_string();
doc.insert_str(0, "\n");
doc
}
}