2024-04-04 16:06:36 +02:00

40 lines
1.1 KiB
Rust

use crate::error_template::{AppError, ErrorTemplate};
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
use crate::components;
use crate::pages;
#[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 <head>
// id=leptos means cargo-leptos will hot-reload this stylesheet
<Stylesheet id="leptos" href="/pkg/application.css"/>
// sets the document title
<Title text="WRB Timings"/>
// 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()
}>
<components::header::Header />
<main>
<Routes>
<Route path="" view=pages::index::HomePage/>
</Routes>
</main>
</Router>
}
}