diff --git a/web/src/app.rs b/web/src/app.rs
index 9e7845ef..8ae651ce 100644
--- a/web/src/app.rs
+++ b/web/src/app.rs
@@ -112,6 +112,7 @@ pub fn App() -> impl IntoView {
} />
+
} />
diff --git a/web/src/control.rs b/web/src/control.rs
index 84ac46cf..73c3c92a 100644
--- a/web/src/control.rs
+++ b/web/src/control.rs
@@ -6,11 +6,24 @@ use crate::prelude::*;
#[component]
pub fn Navigator() -> impl IntoView {
let auth = use_context::().expect("missing auth context");
+ let (query, set_query) = create_signal("".to_string());
view! {
-
-
-
-
+
}
}
diff --git a/web/src/page.rs b/web/src/page.rs
index 03ba6af5..e8e6fd65 100644
--- a/web/src/page.rs
+++ b/web/src/page.rs
@@ -331,3 +331,57 @@ pub fn DebugPage() -> impl IntoView {
}
}
+
+#[component]
+pub fn SearchPage() -> impl IntoView {
+ let auth = use_context::().expect("missing auth context");
+
+ let user = create_local_resource(
+ move || use_query_map().get().get("q").cloned().unwrap_or_default(),
+ move |q| {
+ let user_fetch = Uri::api(FetchKind::User, &q, true);
+ async move { Some(Arc::new(Http::fetch::(&user_fetch, auth).await.ok()?)) }
+ }
+ );
+
+ let object = create_local_resource(
+ move || use_query_map().get().get("q").cloned().unwrap_or_default(),
+ move |q| {
+ let object_fetch = Uri::api(FetchKind::Object, &q, true);
+ async move { Some(Arc::new(Http::fetch::(&object_fetch, auth).await.ok()?)) }
+ }
+ );
+
+ view! {
+ search
+
+
+
+ users
+
+ {move || match user.get() {
+ None => None,
+ Some(None) => None,
+ Some(Some(u)) => Some(view! {
+
+ }),
+ }}
+
+
+
+
+
+
+ objects
+
+ {move || match object.get() {
+ None => None,
+ Some(None) => None,
+ Some(Some(o)) => Some(view! {
+
+ }),
+ }}
+
+
+ }
+}