refactor: 抽离 openChatInfoDialog

This commit is contained in:
CrescentLeaf
2025-10-04 14:55:24 +08:00
parent d6f794a094
commit 5ce97283f1
3 changed files with 23 additions and 24 deletions

View File

@@ -11,15 +11,13 @@ import EventBus from "../../EventBus.ts"
interface Args extends React.HTMLAttributes<HTMLElement> {
display: boolean
chatInfoDialogRef: React.MutableRefObject<Dialog>
openChatInfoDialog: (chat: Chat) => void
addContactDialogRef: React.MutableRefObject<Dialog>
setChatInfo: React.Dispatch<React.SetStateAction<Chat>>
}
export default function ContactsList({
display,
setChatInfo,
chatInfoDialogRef,
openChatInfoDialog,
addContactDialogRef,
...props
}: Args) {
@@ -84,8 +82,7 @@ export default function ContactsList({
/*if (isMultiSelecting)
self.active = !self.active
else*/
setChatInfo(v)
chatInfoDialogRef.current!.open = true
openChatInfoDialog(v)
}}
key={v.id}
contact={v} />