use dioxus::prelude::*;
/// Unread/notification badge component.
#[component]
pub fn UnreadBadge(count: u64, #[props(default = false)] highlight: bool) -> Element {
let class = if highlight {
"unread-badge unread-badge--highlight"
} else {
"unread-badge"
};
let display = if count > 99 {
"99+".to_string()
} else {
count.to_string()
};
rsx! {
span {
class: "{class}",
"{display}"
}
}
}