use crate::utils::prop_structs::ImageProps;
use dioxus::prelude::*;

#[component]
pub fn WerefoxCardTitle(card_title: String, title_emoji: Option<ImageProps>) -> Element {
    rsx! {
        div { class: "rounded-sm ring-2 ring-alice-werefox-red-dark dark:ring-alice-werefox-red",
            p { class: "p-4 text-center text-md sm:text-lg text-alice-werefox-red-dark dark:text-alice-werefox-red-light",
                match title_emoji {
                    Some(t) => rsx! {
                        span {
                            img { class: "object-contain relative inline-block w-8 h-8 mb-1 align-middle",
                                src: "{t.src}",
                                alt: "{t.alt}"
                            }
                        }
                        " {card_title}"
                    },
                    _ => rsx! { "{card_title}" }
                }
            }
        }
    }
}
