From 6ee4190a26f32bfa953302ee363ad3bb6c384ebb Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Sun, 1 Jun 2025 16:10:26 +0100 Subject: refactor: reorganise code --- src/components/chat_header.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/components/chat_header.rs (limited to 'src/components/chat_header.rs') diff --git a/src/components/chat_header.rs b/src/components/chat_header.rs new file mode 100644 index 0000000..208e7f6 --- /dev/null +++ b/src/components/chat_header.rs @@ -0,0 +1,23 @@ +use filamento::user::UserStoreFields; +use leptos::prelude::*; +use reactive_stores::ArcStore; + +use crate::{chat::MacawChat, components::avatar::AvatarWithPresence, user::get_name}; + +#[component] +pub fn ChatViewHeader(chat: MacawChat) -> impl IntoView { + let chat_user = as Clone>::clone(&chat.user).into(); + let name = move || get_name(chat_user, true); + let jid = move || chat_user.jid().read().to_string(); + + view! { +
+ + +
+ } +} + -- cgit