diff --git a/web/src/components/activity.rs b/web/src/components/activity.rs index a85cfad2..1994d4ad 100644 --- a/web/src/components/activity.rs +++ b/web/src/components/activity.rs @@ -1,7 +1,7 @@ use leptos::*; use crate::prelude::*; -use apb::{target::Addressed, Activity, Object}; +use apb::{target::Addressed, Base, Activity, Object}; #[component] @@ -31,3 +31,39 @@ pub fn ActivityLine(activity: crate::Object) -> impl IntoView { } } + +#[component] +pub fn Item(item: crate::Object) -> impl IntoView { + let id = item.id().unwrap_or_default().to_string(); + match item.object_type() { + // special case for placeholder activities + Some(apb::ObjectType::Note) | Some(apb::ObjectType::Document(_)) => + view! { }.into_view(), + // everything else + Some(apb::ObjectType::Activity(t)) => { + let object_id = item.object().id().unwrap_or_default(); + let object = match t { + apb::ActivityType::Create | apb::ActivityType::Announce => + CACHE.get(&object_id).map(|obj| { + view! { } + }.into_view()), + apb::ActivityType::Follow => + CACHE.get(&object_id).map(|obj| { + view! { +
type not implemented
type not implemented
{id}
" "[go]