Lots of fixes for artist detail page and track management
This commit is contained in:
25
frontend/src/components/watch_indicator.rs
Normal file
25
frontend/src/components/watch_indicator.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
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>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user