feat: add cuddle leptos

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-09-07 22:08:35 +02:00
parent 7688d45cc1
commit c13631cf7f
26 changed files with 3345 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
use crate::error_template::{AppError, ErrorTemplate};
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
use serde::{Deserialize, Serialize};
pub mod error_template;
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
view! {
<Stylesheet id="leptos" href="/pkg/%%name%%.css"/>
// sets the document title
<Title text="%%name%%"/>
// content for this welcome page
<Router fallback=|| {
let mut outside_errors = Errors::default();
outside_errors.insert_with_default_key(AppError::NotFound);
view! { <ErrorTemplate outside_errors/> }.into_view()
}>
<main>
<Routes>
<Route ssr=SsrMode::Async path="" view=HomePage/>
</Routes>
</main>
</Router>
}
}