use leptos::*;
use crate::prelude::*;
use apb::{target::Addressed, Base, Activity, Object};
#[component]
pub fn ActivityLine(activity: crate::Object) -> impl IntoView {
let object_id = activity.object().id().unwrap_or_default();
let activity_url = activity.id().map(|x| view! {
"↗"
});
let actor_id = activity.actor().id().unwrap_or_default();
let actor = CACHE.get_or(&actor_id, serde_json::Value::String(actor_id.clone()).into());
let kind = activity.activity_type().unwrap_or(apb::ActivityType::Activity);
let href = match kind {
apb::ActivityType::Follow => Uri::web(U::User, &object_id),
// TODO for update check what's being updated
_ => Uri::web(U::Object, &object_id),
};
view! {