diff --git a/app/src/user_table.rs b/app/src/user_table.rs index dfba040..91fc798 100644 --- a/app/src/user_table.rs +++ b/app/src/user_table.rs @@ -61,14 +61,39 @@ impl Component for UserTable { } fn view(&self) -> Html { - html! { -

{ - match &self.users { - None => "Loading...".to_string(), - Some(Ok(users)) => format!("Users: {:?}", &users), - Some(Err(e)) => e.to_string(), + match &self.users { + None => html! {{"Loading..."}}, + Some(Err(e)) => html! {

{"Error: "}{e.to_string()}
}, + Some(Ok(users)) => { + let table_content: Vec<_> = users + .iter() + .map(|u| { + html! { + + {&u.user_id} + {&u.email} + {&u.display_name.as_ref().unwrap_or(&String::new())} + {&u.first_name.as_ref().unwrap_or(&String::new())} + {&u.last_name.as_ref().unwrap_or(&String::new())} + {&u.creation_date} + + } + }) + .collect(); + html! { + + + + + + + + + + {table_content} +
{"User ID"}{"Email"}{"Display name"}{"First name"}{"Last name"}{"Creation date"}
} - }

+ } } } }