wip: refactor

This commit is contained in:
2025-01-11 09:16:30 +07:00
parent 38d0061796
commit 08980e55a4
10 changed files with 379 additions and 428 deletions

View File

@@ -1,4 +1,4 @@
use crate::{get_client, states::chat::Room, utils::room_hash};
use crate::{get_client, states::chat::room::Room};
use gpui::{
div, list, px, AnyElement, AppContext, Context, EventEmitter, Flatten, FocusHandle,
FocusableView, IntoElement, ListAlignment, ListState, Model, ParentElement, PathPromptOptions,
@@ -40,8 +40,8 @@ pub struct ChatPanel {
}
impl ChatPanel {
pub fn new(room: &Arc<Room>, cx: &mut WindowContext) -> View<Self> {
let room = Arc::clone(room);
pub fn new(room_id: &u64, cx: &mut WindowContext) -> View<Self> {
let room = Arc::new(room);
let id = room.id.clone();
let name = room.title.clone().unwrap_or("Untitled".into());