use leptos::prelude::*;
use filamento::{chat::Delivery, presence::Show};
use crate::icon::Icon;
// TODO: rename
#[component]
pub fn IconComponent(icon: Icon) -> impl IntoView {
view! {
}
}
pub fn show_to_icon(show: Show) -> Icon {
match show {
Show::Away => Icon::Away16Color,
Show::Chat => Icon::Chat16Color,
Show::DoNotDisturb => Icon::Dnd16Color,
Show::ExtendedAway => Icon::Xa16Color,
}
}
#[component]
pub fn Delivery(delivery: Delivery) -> impl IntoView {
match delivery {
// TODO: proper icon coloring/theming
Delivery::Sending => {
view! { }
.into_any()
}
Delivery::Written => {
view! { }.into_any()
}
// TODO: message receipts
// Delivery::Written => view! {}.into_any(),
Delivery::Sent => view! { }.into_any(),
Delivery::Delivered => {
view! { }.into_any()
}
// TODO: check if there is also the icon class
Delivery::Read => {
view! { }
.into_any()
}
Delivery::Failed => {
view! { }
.into_any()
}
// TODO: queued icon
Delivery::Queued => {
view! { }
.into_any()
}
}
}