use leptos::prelude::*; use leptos_meta::{provide_meta_context, MetaTags, Stylesheet, Title}; use leptos_router::{ components::{ParentRoute, Route, Router, Routes}, path, StaticSegment }; use crate::components::layout::Layout; 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! { // injects a stylesheet into the document // id=leptos means cargo-leptos will hot-reload this stylesheet // sets the document title // content for this welcome page <Router> <Routes fallback=|| "Page not found.".into_view()> <ParentRoute path=path!("/") view=Layout> <Route path=path!("/") view=HomePage/> </ParentRoute> </Routes> </Router> } } /// Renders the home page of your application. #[component] fn HomePage() -> impl IntoView { // Creates a reactive value to update the button let count = RwSignal::new(0); let on_click = move |_| *count.write() += 1; view! { <h1>"Welcome to Leptos!"</h1> <button on:click=on_click>"Click Me: " {count}</button> } }