//! Client-side theme configuration using embedded constants
//!
//! !This module provides access to theme configuration embedded at build time
//! for WASM clients, allowing them to access theme settings without filesystem access.

use rustelo_web::rustelo_core_lib::defs::LogoConfig;

// Include the generated theme constants (defines inner `pub mod theme { ... }`).
// Re-export the constants used by lib.rs so `crate::theme::THEME_TOML` resolves.
include!(concat!(env!("OUT_DIR"), "/theme_constants.rs"));
pub use theme::THEME_TOML;
pub use theme::DEFAULT_THEME_NAME;

/// Build logo configuration from constants generated from site/config.ncl.
/// `href` is intentionally omitted — home URL is language-dependent and
/// must be derived at runtime via `localize_url("/", &lang)`.
pub fn load_logo_config() -> LogoConfig {
    LogoConfig {
        light_src: theme::logo::LIGHT_SRC.to_string(),
        dark_src: theme::logo::DARK_SRC.to_string(),
        alt: theme::logo::ALT.to_string(),
        href: String::new(), // resolved per-language at render time
        show_in_nav: theme::logo::SHOW_IN_NAV,
        show_in_footer: theme::logo::SHOW_IN_FOOTER,
        width: theme::logo::WIDTH.map(|w| w.to_string()),
        height: theme::logo::HEIGHT.map(|h| h.to_string()),
    }
}

// Get the default theme name
pub fn default_theme_name() -> &'static str {
    theme::DEFAULT_THEME_NAME
}
