Its more beautifull now
This commit is contained in:
2026-05-13 23:00:46 +02:00
parent b25e045b99
commit e99026e3d6
2 changed files with 36 additions and 0 deletions

View File

@@ -575,3 +575,38 @@ fn user_total_component(props: &UserTotalProps) -> Html {
</div>
}
}
#[component(EasyFixCount)]
fn easy_fix_component() -> Html {
let count = use_state(|| 0);
let error = use_state(|| None::<String>);
{
let count = count.clone();
let error = error.clone();
use_effect_with((), move |_| {
spawn_local(async move {
match Request::get("/api/count").send().await {
Ok(resp) if resp.status() == 200 => match resp.json::<CountResponse>().await {
Ok(r) => count.set(r.value),
Err(e) => error.set(Some(format!("parse error: {}", e))),
},
Ok(resp) => error.set(Some(
resp.text()
.await
.unwrap_or_else(|_| format!("status {}", resp.status())),
)),
Err(e) => error.set(Some(format!("Network error: {}", e))),
}
});
|| ()
});
}
html! {
<div class="open-tickets">
<h2 class="left">{ "Probleme ohne Ticket gelößt" }</h2>
<h4 class="ticket_count center">{ *count }</h4>
</div>
}
}

View File

@@ -192,6 +192,7 @@
display: flex;
align-items: center;
flex-shrink: 0;
max-width: 30%;
h2 {
margin: 0;