add ssr rust
This commit is contained in:
25
rust/src/components/home.rs
Normal file
25
rust/src/components/home.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use super::Tree;
|
||||
use axohtml::html;
|
||||
|
||||
pub struct Home {
|
||||
doc: Tree,
|
||||
}
|
||||
|
||||
impl Home {
|
||||
pub fn build() -> Self {
|
||||
let doc = html!(
|
||||
<div id="home" class=["p-8", "max-w-xl"]>
|
||||
<p><a href="/inventory">"Inventory"</a></p>
|
||||
<p><a href="/trips">"Trips"</a></p>
|
||||
</div>
|
||||
);
|
||||
|
||||
Self { doc }
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Tree> for Home {
|
||||
fn into(self) -> Tree {
|
||||
self.doc
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user