//! Server-side App component for SSR
//!
//! Renders only the shell and nav during SSR
//! Page content is loaded client-side after hydration

use leptos::prelude::*;
use rustelo_web::rustelo_components_leptos::navigation::NavMenu;
use rustelo_web::rustelo_components_leptos::theme::ThemeProvider;

/// Main App component for server-side rendering
/// Takes the request path (for context) but renders placeholder for pages
#[component]
pub fn AppComponent(#[prop(default = String::new())] path: String) -> impl IntoView {
    view! {
        <ThemeProvider>
            <div class="min-h-screen ds-bg-page flex flex-col">
                <NavMenu />
                <main class="max-w-7xl mx-auto py-2 sm:ds-container flex-grow page-content fade-out">
                    // SSR placeholder - actual content loads on client
                    <div class="text-center text-gray-600">"Loading..."</div>
                </main>
                <footer class="border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 py-8">
                    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                        <div class="text-center text-gray-600 dark:text-gray-400">
                            <p>"© 2026 Jesús Pérez. All rights reserved."</p>
                        </div>
                    </div>
                </footer>
            </div>
        </ThemeProvider>
    }
}
