use crate::error_template::{AppError, ErrorTemplate}; use leptos::prelude::*; use leptos_meta::*; use leptos_router::{components::*, StaticSegment}; pub mod error_template; #[cfg(feature = "ssr")] pub mod state; pub fn shell(options: LeptosOptions) -> impl IntoView { view! { } } #[component] pub fn App() -> impl IntoView { // Provides context that manages stylesheets, titles, meta tags, etc. provide_meta_context(); view! { // sets the document title // content for this welcome page <Router> <main class=""> <Routes fallback=|| { let mut outside_errors = Errors::default(); outside_errors.insert_with_default_key(AppError::NotFound); view! { <ErrorTemplate outside_errors /> }.into_view() }> <Route path=StaticSegment("") view=pages::home::HomePage /> </Routes> </main> </Router> } } #[component] pub fn HomePage() -> impl IntoView { view! { <h1> "%%name%%" </h1> } }