use leptos::prelude::*;

fn empty_view() -> AnyView {
    ().into_any()
}

#[component]
pub fn ProtectedRoute<T, V>(
    _path: &'static str,
    view: T,
    children: Option<Children>,
) -> impl IntoView
where
    T: Fn() -> V + 'static,
    V: IntoView + 'static,
{
    // For now, just render the view directly - in a real app, check auth state
    view! {
        <>
            {view().into_any()}
            {children.map(|child| child().into_any()).unwrap_or_else(empty_view)}
        </>
    }
}
