Server container

This commit is contained in:
2025-07-11 14:34:53 +02:00
parent b8f82399e1
commit 8f275c38a5
3 changed files with 204 additions and 28 deletions
+7 -2
View File
@@ -153,9 +153,14 @@ pub fn RadialChart(percent: f64) -> Element {
}
#[component]
pub fn ProgressBar(percent: u8, id: Option<String>) -> Element {
pub fn ProgressBar(percent: u8, class: Option<String>) -> Element {
let class_attr = match class {
Some(c) => format!("progress-bar {}", c),
None => "progress-bar".to_string(),
};
rsx! {
span { class: "progress-bar", id: id,
span { class: "{class_attr}",
span { class: "progress", style: format!("width: {}%; background-color: currentColor;", percent.clamp(0, 100)) }
}
}