From bc00fa4af57e5a3062d06233abdc947e6348ec1a Mon Sep 17 00:00:00 2001 From: meraghon Date: Fri, 5 Dec 2025 07:59:46 -0500 Subject: [PATCH] Fixing --- src/components/dashboard_button.rs | 38 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/components/dashboard_button.rs b/src/components/dashboard_button.rs index a8d558c..e6cb4cb 100644 --- a/src/components/dashboard_button.rs +++ b/src/components/dashboard_button.rs @@ -1,10 +1,28 @@ use leptos::prelude::*; use leptos_router::hooks::use_navigate; + +/// #Dashboard Button Component +/// +/// This component displays a large panel-like button that redirects a user to a specified page. +/// It's best used on a user dashboard, where multiple instances of the button are present. +/// It has a title, description, and icon +/// +/// Example usage: +/// ``` +///
+/// +///
+/// ``` #[component] pub fn DashboardButton( #[prop(into)] title: String, - #[prop(into, optional)] description: Option, - #[prop(into, optional)] icon: Option, + #[prop(into)] description: String, + #[prop(into)] icon: String, #[prop(into)] path: String, ) -> impl IntoView { let navigate = use_navigate(); @@ -20,13 +38,15 @@ pub fn DashboardButton( on:click=on_click>
- {icon.as_ref().map(|src| view! { - icon - })} -

{title.clone()}

- {description.as_ref().map(|d| view! { -

{d.clone()}

- })} + icon +

+ {title.clone()} +

+ +

+ {description.clone()} +

+
}