## status modal usage: ```rust let modal = create_rw_signal(false); view! { } ``` ## confirm modal usage: ```rust let signal = create_rw_signal(false); let action = create_action(move |_input: &()| async move { let result = server_function().await; match result { Ok(result) => { log::info!("Action Successful!"); signal.set(false); // Close the modal after successful action. return result }, Err(err) => { log::error!("Server Function Error: {:?}", err); signal.set(false); // Close the modal after unsuccessful action. return format!("Server Function Error: {:?}", err); } } }); let pending_signal = action.pending(); // Renders a spinner when the action is still pending. let confirm_modal_fn = move || { action.dispatch(()); // Calls the actual action inside a closure function. }; view! { } pub async fn server_function() -> Result{ use gloo_timers::future::sleep; use std::time::Duration; log::info!("Server Function!"); sleep(Duration::from_secs(1)).await; // Add a delay to simulate pending data. return Ok(String::from("This came from a server function.")) } ``` ## what goes inside the confirm modal: ```rust let position_class = match custom_position_class { None => { match position { Some(Position::TopLeft) => "items-start justify-start".to_string(), Some(Position::TopCenter) => "items-start justify-center".to_string(), Some(Position::TopRight) => "items-start justify-end".to_string(), Some(Position::Center) => "items-center justify-center".to_string(), Some(Position::BottomLeft) => "items-end justify-start".to_string(), Some(Position::BottomCenter) => "items-end justify-center".to_string(), Some(Position::BottomRight) => "items-end justify-end".to_string(), _ => "items-center justify-center".to_string(), } }, Some(custom_class) => custom_class, }; let on_click = move |_| function(); view! {

{title.clone()}

{description.clone()}

} ``` ## what goes inside the status modal: ```rust let status_class = match status { Some(ComponentStatus::Info) => "bg-info", Some(ComponentStatus::Success) => "bg-success", Some(ComponentStatus::Neutral) => "bg-neutral", Some(ComponentStatus::Warning) => "bg-warning", Some(ComponentStatus::Error) => "bg-error", _ => "", }; let text_header_class = match text_color { Some(ComponentStatus::Info) => "text-info", Some(ComponentStatus::Success) => "text-success", Some(ComponentStatus::Neutral) => "text-neutral", Some(ComponentStatus::Warning) => "text-warning", Some(ComponentStatus::Error) => "text-error", _ => "text-black", }; let text_desc_class = match text_color { Some(ComponentStatus::Info) => "text-black", Some(ComponentStatus::Success) => "text-black", Some(ComponentStatus::Neutral) => "", Some(ComponentStatus::Warning) => "text-black", Some(ComponentStatus::Error) => "text-black", _ => "", }; let button_class = match button_status { Some(ComponentStatus::Info) => "btn btn-sm rounded btn-info", Some(ComponentStatus::Success) => "btn btn-sm rounded btn-success", Some(ComponentStatus::Neutral) => "btn btn-sm rounded", Some(ComponentStatus::Warning) => "btn btn-sm rounded btn-warning", Some(ComponentStatus::Error) => "btn btn-sm rounded btn-error", _ => "btn btn-sm rounded", }; let position_class = match custom_position_class { None => { match position { Some(Position::TopLeft) => "items-start justify-start".to_string(), Some(Position::TopCenter) => "items-start justify-center".to_string(), Some(Position::TopRight) => "items-start justify-end".to_string(), Some(Position::Center) => "items-center justify-center".to_string(), Some(Position::BottomLeft) => "items-end justify-start".to_string(), Some(Position::BottomCenter) => "items-end justify-center".to_string(), Some(Position::BottomRight) => "items-end justify-end".to_string(), _ => "items-center justify-center".to_string(), } }, Some(custom_class) => custom_class, }; view! {

{title.clone()}

{description.clone()}

} ```