(#[prop()] key: String, account_id: String, name: String)
| 23 | #[tracing::instrument(level = "debug", skip(key, account_id, name))] |
| 24 | #[component] |
| 25 | pub fn SignoutModal(#[prop()] key: String, account_id: String, name: String) -> impl IntoView { |
| 26 | let modal_store: RwSignal<ModalStore> = expect_context(); |
| 27 | let close_modal = move |_| modal_store.update(|m| m.clear_active_modal()); |
| 28 | |
| 29 | let signout = move |_| { |
| 30 | let key = key.clone(); |
| 31 | let account_id = account_id.clone(); |
| 32 | spawn_local(async move { |
| 33 | provider_signout(key, account_id).await.unwrap(); |
| 34 | |
| 35 | modal_store.update(|m| m.clear_active_modal()); |
| 36 | }); |
| 37 | }; |
| 38 | view! { |
| 39 | <GenericModal size=move || "modal-lg".into()> |
| 40 | <div class="container-fluid p-0 mt-4"> |
| 41 | <div class="row no-gutters d-flex"> |
| 42 | <div class="col"> |
| 43 | <h4> |
| 44 | Are you sure you want to <span class="keyword">log out from</span> |
| 45 | <span class="logout-item">{name.clone()}</span>? |
| 46 | </h4> |
| 47 | <h6 class="mt-3">Press Confirm if you are sure</h6> |
| 48 | </div> |
| 49 | </div> |
| 50 | <div class="row row-cols-auto mt-3 mr-4"> |
| 51 | <button |
| 52 | on:click=close_modal |
| 53 | class="btn btn-secondary cancel-button ml-auto" |
| 54 | type="button" |
| 55 | > |
| 56 | Cancel |
| 57 | </button> |
| 58 | <button |
| 59 | on:click=signout |
| 60 | class="btn btn-secondary confirm-button ml-3" |
| 61 | type="button" |
| 62 | > |
| 63 | Confirm |
| 64 | </button> |
| 65 | </div> |
| 66 | </div> |
| 67 | </GenericModal> |
| 68 | } |
| 69 | } |
no test coverage detected