From 962c644125952341ab4c1b20cdf6a13bc91813db Mon Sep 17 00:00:00 2001
From: Sridhar Ratnakumar
Date: Mon, 7 Aug 2023 14:38:59 -0400
Subject: [PATCH] Revamp ErrorMessage so it renders the error signal fully
---
src/app.rs | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/app.rs b/src/app.rs
index 6e414c8b..cdb249c0 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -41,17 +41,13 @@ fn Home(cx: Scope) -> impl IntoView {
Welcome to nix-browser
"Nix Info"
-
+
"Loading nix-info" }>
-
- }
- >
- {nix_info.read(cx)}
+ } >
+ {nix_info.read(cx)}
-
+
@@ -93,11 +89,20 @@ fn NotFound(cx: Scope) -> impl IntoView {
}
}
+/// Display errors to the user
#[component]
-fn ErrorMessage>(cx: Scope, message: S) -> impl IntoView {
+fn Errors(cx: Scope, errors: Errors) -> impl IntoView {
view! { cx,
-
- {message.into()}
+
+
+
+ {errors
+ .into_iter()
+ .map(|(_, e)| view! { cx, - {e.to_string()}
})
+ .collect_view(cx)
+ }
+
+
}
}