use leptos::prelude::*;

#[component]
pub fn LoadingSpinner(#[prop(optional)] size: Option<&'static str>) -> impl IntoView {
    let size_class = size.unwrap_or("loading-md");
    view! {
        <div class=format!("loading loading-spinner {}", size_class)></div>
    }
}

#[component]
pub fn LoadingPage() -> impl IntoView {
    view! {
        <div class="min-h-screen-75 flex items-center justify-center">
            <div class="text-center">
                <LoadingSpinner size="loading-lg" />
                <p class="mt-4 text-base-content/70">"Loading..."</p>
            </div>
        </div>
    }
}
