use leptos::*;

#[component]
pub fn Subtitle(cx: Scope, class: &'static str, children: Children) -> impl IntoView {
    let class = format!("text-3xl font-bold text-white {}", class);
    view! { cx,
        <h3 class={class}>{children(cx)}</h3>
    }
}

#[component]
pub fn SectionTitle(cx: Scope, dark: bool, children: Children) -> impl IntoView {
    let mut textColorClass = "text-blue-950";
    if dark {
        textColorClass = "text-white";
    }
    let class = format!("text-5xl font-bold text-center {}", textColorClass);
    view! { cx,
        <h2 class={class}>{children(cx)}</h2>
    }
}

#[component]
pub fn SubsectionTitle(cx: Scope, dark: bool, children: Children) -> impl IntoView {
    let mut textColorClass = "text-blue-950";
    if dark {
        textColorClass = "text-white";
    }
    let class = format!("text-3xl font-bold {}", textColorClass);
    view! { cx,
        <h5 class={class}>{children(cx)}</h5>
    }
}
