//! Server-side Page Transition Components
//!
//! Static implementation of page transition components for server-side
//! rendering.

use leptos::prelude::*;

// Import the unified TransitionStyle instead of defining a duplicate
use super::unified::TransitionStyle;

/// Server-side page transition wrapper component (renders without transitions
/// for SSR)
#[component]
pub fn PageTransition(
    /// Signal that triggers the transition (usually the route path)
    _trigger: ReadSignal<String>,
    /// Children to render with transitions
    children: Children,
    /// Transition style to use (ignored in SSR)
    #[prop(default = TransitionStyle::Fade)]
    _style: TransitionStyle,
    /// Duration of the transition in milliseconds (ignored in SSR)
    #[prop(default = 300)]
    _duration_ms: u64,
) -> impl IntoView {
    // For SSR, just render content without transitions
    view! {
        <div class="page-transition-wrapper">
            <div class="page-content">
                {children()}
            </div>
        </div>
    }
}

/// Server-side simple page transition component (renders without transitions)
#[component]
pub fn SimplePageTransition(
    /// Children to render with transitions
    children: Children,
    /// Additional CSS classes
    #[prop(default = String::new())]
    class: String,
) -> impl IntoView {
    view! {
        <div class=format!("page-content {}", class)>
            {children()}
        </div>
    }
}
