Search Bar
Search requests
This commit is contained in:
2025-05-03 22:21:11 -04:00
parent 3eac4e619e
commit e223612a08
17 changed files with 191 additions and 69 deletions

View File

@@ -2,8 +2,9 @@ use dioxus::prelude::*;
#[derive(PartialEq, Clone, Props)]
pub struct ButtonProps {
variant: Option<ButtonVariant>,
text: String,
pub variant: Option<ButtonVariant>,
pub text: String,
pub onclick: Option<EventHandler<Event<MouseData>>>,
}
#[derive(PartialEq, Clone)]
@@ -16,6 +17,13 @@ pub enum ButtonVariant {
#[component]
pub fn Button(props: ButtonProps) -> Element {
rsx! {
button { "{props.text}" }
button {
onclick: move |event| {
if let Some(h) = props.onclick {
h.call(event);
}
},
"{props.text}"
}
}
}