use crate::util::surrealdb::{client::Time, schemas}; use leptos::*; /// Renders the home page of your application. #[component] pub fn Modal() -> impl IntoView { let participant_id = use_context::>>().unwrap(); let participants = use_context::().unwrap(); let participant = move || { let x = participants .get() .into_iter() .filter(|item| item.id == participant_id.get().unwrap_or("".to_string())) .collect::>(); match x.get(0) { Some(participant) => Some(participant.value), None => None, } }; let time_lifesaver = create_rw_signal(Time { minutes: 0, seconds: 0, milliseconds: 0, }); let time_hindernis = create_rw_signal(Time { minutes: 0, seconds: 0, milliseconds: 0, }); let time_popduiken = create_rw_signal(Time { minutes: 0, seconds: 0, milliseconds: 0, }); view! { { move || match participant() { Some(p) => view! { }.into_view(), None => view! {}.into_view() }} } }