pub mod app;
pub mod pages {
    pub mod edit_wall;
    pub mod routes;
    pub mod settings;
    pub mod wall;
}
pub mod components {
    pub use attempt::Attempt;
    pub use button::Button;
    pub use header::StyledHeader;
    pub use problem::Problem;
    pub use problem_info::ProblemInfo;

    pub mod attempt;
    pub mod button;
    pub mod checkbox;
    pub mod header;
    pub mod icons;
    pub mod outlined_box;
    pub mod problem;
    pub mod problem_info;
}

pub mod gradient;

pub mod resources;

pub mod codec;
pub mod models;
pub mod server_functions;

#[cfg(feature = "ssr")]
pub mod server;

#[cfg(feature = "hydrate")]
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn hydrate() {
    use crate::app::*;

    console_error_panic_hook::set_once();

    tracing_subscriber::fmt()
        .with_env_filter(
            tracing_subscriber::EnvFilter::builder()
                .with_default_directive(tracing::level_filters::LevelFilter::DEBUG.into())
                .from_env_lossy(),
        )
        .with_writer(
            // To avoide trace events in the browser from showing their JS backtrace
            tracing_subscriber_wasm::MakeConsoleWriter::default().map_trace_level_to(tracing::Level::DEBUG),
        )
        // For some reason, if we don't do this in the browser, we get a runtime error.
        .without_time()
        .with_ansi(false)
        .init();

    leptos::mount::hydrate_body(App);
}
