Jesús Pérez b6a4d77421
Some checks are pending
Documentation Lint & Validation / Markdown Linting (push) Waiting to run
Documentation Lint & Validation / Validate mdBook Configuration (push) Waiting to run
Documentation Lint & Validation / Content & Structure Validation (push) Waiting to run
Documentation Lint & Validation / Lint & Validation Summary (push) Blocked by required conditions
mdBook Build & Deploy / Build mdBook (push) Waiting to run
mdBook Build & Deploy / Documentation Quality Check (push) Blocked by required conditions
mdBook Build & Deploy / Deploy to GitHub Pages (push) Blocked by required conditions
mdBook Build & Deploy / Notification (push) Blocked by required conditions
Rust CI / Security Audit (push) Waiting to run
Rust CI / Check + Test + Lint (nightly) (push) Waiting to run
Rust CI / Check + Test + Lint (stable) (push) Waiting to run
feat: add Leptos UI library and modularize MCP server
2026-02-14 20:10:55 +00:00

43 lines
1.2 KiB
Rust

use leptos::prelude::*;
#[component]
pub fn StatCardClient(
label: String,
value: String,
change: Option<String>,
trend_positive: bool,
icon: Option<Children>,
class: &'static str,
) -> impl IntoView {
let trend_color = if trend_positive {
"text-green-400"
} else {
"text-red-400"
};
view! {
<div class={format!("ds-card p-6 {}", class)}>
<div class="flex items-start justify-between">
<div class="flex-1">
<p class="text-sm text-white/60 mb-1">{label}</p>
<p class="text-3xl font-bold text-white">{value}</p>
{change.map(|ch| {
view! {
<p class={format!("text-sm mt-2 {}", trend_color)}>
{ch}
</p>
}
})}
</div>
{icon.map(|icon_fn| {
view! {
<div class="ml-4">
{icon_fn()}
</div>
}
})}
</div>
</div>
}
}