summaryrefslogtreecommitdiffstats
path: root/src/components/chat_header.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/components/chat_header.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/chat_header.rs b/src/components/chat_header.rs
new file mode 100644
index 0000000..3fb5df8
--- /dev/null
+++ b/src/components/chat_header.rs
@@ -0,0 +1,26 @@
+// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden>
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+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 name = move || get_name(chat.user.get().into(), true);
+ let jid = move || chat.user.get().jid().read().to_string();
+
+ view! {
+ <div class="chat-view-header panel">
+ {move || {
+ view! { <AvatarWithPresence user=chat.user /> }
+ }} <div class="user-info">
+ <h2 class="name">{name}</h2>
+ <h3>{jid}</h3>
+ </div>
+ </div>
+ }
+}