Some checks failed
CI / Clippy (push) Successful in 2m35s
CI / Security Audit (push) Successful in 1m46s
CI / Tests (push) Successful in 3m5s
CI / Format (push) Successful in 6m53s
CI / Build & Push Image (push) Failing after 1m54s
CI / Changelog (push) Failing after 1m39s
Co-authored-by: Sharang Parnerkar <parnerkarsharang@gmail.com> Reviewed-on: #2
21 lines
724 B
Rust
21 lines
724 B
Rust
use dioxus::prelude::*;
|
|
|
|
/// Reusable dashboard card with icon, title, description and click-through link.
|
|
///
|
|
/// # Arguments
|
|
///
|
|
/// * `title` - Card heading text.
|
|
/// * `description` - Short description shown beneath the title.
|
|
/// * `href` - URL the card links to when clicked.
|
|
/// * `icon` - Element rendered as the card icon (typically a `dioxus_free_icons::Icon`).
|
|
#[component]
|
|
pub fn DashboardCard(title: String, description: String, href: String, icon: Element) -> Element {
|
|
rsx! {
|
|
a { class: "dashboard-card", href: "{href}",
|
|
div { class: "card-icon", {icon} }
|
|
h3 { class: "card-title", "{title}" }
|
|
p { class: "card-description", "{description}" }
|
|
}
|
|
}
|
|
}
|