use leptos::prelude::*;

use crate::theme::{BlurLevel, GlowColor};

#[component]
pub fn CardSSR(
    children: Children,
    blur: BlurLevel,
    glow: GlowColor,
    hoverable: bool,
    class: &'static str,
) -> impl IntoView {
    let base_classes = "ds-card p-6";
    let hover_classes = if hoverable {
        "ds-card-hover cursor-pointer"
    } else {
        ""
    };
    let combined_classes = format!(
        "{} {} {} {} {}",
        base_classes,
        blur.classes(),
        glow.classes(),
        hover_classes,
        class
    );

    view! {
        <div class=combined_classes>
            {children()}
        </div>
    }
}
