## 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! {