//! Unified footer component interface using shared delegation patterns
//!
//! This module provides a unified interface that automatically selects between
//! client-side reactive and server-side static implementations based on context.

use leptos::prelude::*;
// Fix Leptos macro conflicts with our 'core' crate
use std::{default::Default, marker::PhantomData};

#[cfg(not(target_arch = "wasm32"))]
use crate::navigation::footer::ssr::FooterSSR;

#[cfg(target_arch = "wasm32")]
use crate::navigation::footer::client::FooterClient;

/// Unified footer component that delegates to appropriate implementation
#[component]
pub fn Footer(
    #[prop(optional)] language: Option<String>,
    #[prop(optional)] class: Option<String>,
    #[prop(default = true)] show_social: bool,
    #[prop(default = true)] show_scroll_to_top: bool,
) -> impl IntoView {
    #[cfg(not(target_arch = "wasm32"))]
    {
        // SSR context: use static implementation
        view! {
            <FooterSSR
                language=language.unwrap_or_default()
                class=class.unwrap_or_default()
                show_social=show_social
                show_scroll_to_top=show_scroll_to_top
            />
        }
    }

    #[cfg(target_arch = "wasm32")]
    {
        // Client context: use reactive implementation
        view! {
            <FooterClient
                class=class.unwrap_or_default()
                show_social=show_social
                show_scroll_to_top=show_scroll_to_top
            />
        }
    }
}
