26 lines
837 B
Rust
26 lines
837 B
Rust
use yew::prelude::*;
|
|
|
|
#[derive(Properties, PartialEq)]
|
|
pub struct Props {
|
|
pub status: String,
|
|
}
|
|
|
|
#[function_component(WatchIndicator)]
|
|
pub fn watch_indicator(props: &Props) -> Html {
|
|
let (icon, color, title) = match props.status.as_str() {
|
|
"owned" => ("●", "var(--success)", "Owned"),
|
|
"partial" => ("◐", "var(--warning)", "Partial"),
|
|
"wanted" => ("○", "var(--accent)", "Wanted"),
|
|
"downloading" => ("↓", "var(--accent)", "Downloading"),
|
|
"fully_watched" => ("●", "var(--accent)", "Fully watched"),
|
|
"unwatched" => ("○", "var(--text-muted)", "Not watched"),
|
|
_ => ("○", "var(--text-muted)", "Unknown"),
|
|
};
|
|
|
|
html! {
|
|
<span style={format!("color: {color}; font-size: 1.1em; cursor: help;")} title={title}>
|
|
{ icon }
|
|
</span>
|
|
}
|
|
}
|