// Auto-generated wrapper components for AdminUser
// Calls existing UnifiedAdminUserPage from
// crates/pages/src/admin/user/unified.rs

// Use qualified paths to avoid import conflicts between generated files
use leptos::prelude::*;

use super::unified::UnifiedAdminUserPage;

/// Client-side reactive page component (wrapper)
#[component]
pub fn AdminUserClient(
    #[prop(default = rustelo_core_lib::config::get_default_language().to_string())]
    _language: String,
) -> impl IntoView {
    // Use the existing use_page_i18n_dynamic function
    let page_content = crate::common::use_page_i18n_dynamic(vec!["admin-user-"], || vec![]);

    let lang_content = page_content.get_untracked();

    view! {
        <UnifiedAdminUserPage
            _language=_language
            lang_content=lang_content
        />
    }
}

/// SSR static page component (wrapper)
#[component]
pub fn AdminUserSSR(
    #[prop(default = rustelo_core_lib::config::get_default_language().to_string())]
    _language: String,
) -> impl IntoView {
    // Create static translator for SSR
    let translator = rustelo_core_lib::i18n::page_translator::SsrTranslator::new(_language.clone());
    let patterns: Vec<&str> = vec!["admin-user-"];
    let lang_content =
        rustelo_core_lib::i18n::helpers::build_page_content_patterns(&translator, &patterns);

    view! {
        <UnifiedAdminUserPage
            _language=_language.clone()
            lang_content=lang_content
        />
    }
}

/// Main page component with delegation
#[component]
pub fn AdminUserPage(
    #[prop(default = rustelo_core_lib::config::get_default_language().to_string())]
    _language: String,
) -> impl IntoView {
    #[cfg(not(target_arch = "wasm32"))]
    {
        view! { <AdminUserSSR _language=_language.clone() /> }
    }

    #[cfg(target_arch = "wasm32")]
    {
        view! { <AdminUserClient _language=_language.clone() /> }
    }
}
