#![recursion_limit = "256"]
#![allow(unused_variables, dead_code)]

pub mod app;

/// WASM entry point: called automatically by the JS loader via `wasm_bindgen(start)`.
///
/// Hydrates the server-rendered HTML with client-side Leptos reactivity.
/// The component tree passed to `hydrate_body` must be structurally identical
/// to what the server rendered — any difference causes a hydration cursor mismatch.
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn main() {
    use leptos::prelude::*;

    console_error_panic_hook::set_once();

    let initial_path = web_sys::window()
        .and_then(|w| w.location().pathname().ok())
        .unwrap_or_default();

    leptos::mount::hydrate_body(move || {
        view! { <crate::app::AppComponent path=initial_path.clone() /> }
    });
}
