{
+ display: boolean
+ currentChatId: string
+ openChatInfoDialog: (chat: Chat) => void
+}
+
+export default function AllChatsList({ ...props }: React.HTMLAttributes
) {
+
+ const searchRef = React.useRef(null)
+ const [searchText, setSearchText] = React.useState('')
+ const [allChatsList, setAllChatsList] = React.useState([])
+
+ useEventListener(searchRef, 'input', (e) => {
+ setSearchText((e.target as unknown as TextField).value)
+ })
+
+ useAsyncEffect(async () => {
+ async function updateAllChats() {
+ try {
+ setAllChatsList(await (await UserMySelf.getMySelfOrThrow(getClient())).getMyAllChatsOrThrow())
+ } catch (e) {
+ if (e instanceof CallbackError)
+ if (e.code == 401 || e.code == 400)
+ showSnackbar({
+ message: '获取所有对话失败: ' + e.message
+ })
+ }
+ }
+ updateAllChats()
+ return () => {
+ }
+ })
+
+ return
+
+ {
+ allChatsList.filter((chat) =>
+ searchText == '' ||
+ chat.getTitle().includes(searchText) ||
+ chat.getId().includes(searchText)
+ ).map((v) =>
+ {
+ openChatInfoDialog(v)
+ }}
+ chat={v} />
+ )
+ }
+
+}
\ No newline at end of file
diff --git a/client/ui/main-page/AllChatsListItem.tsx b/client/ui/main-page/AllChatsListItem.tsx
new file mode 100644
index 0000000..156c6ea
--- /dev/null
+++ b/client/ui/main-page/AllChatsListItem.tsx
@@ -0,0 +1,29 @@
+import { $ } from "mdui/jq"
+import Avatar from "../Avatar.tsx"
+import React from 'react'
+import { Chat } from "lingchair-client-protocol"
+import getClient from "../../getClient.ts"
+
+interface Args extends React.HTMLAttributes {
+ chat: Chat
+ active?: boolean
+}
+
+export default function AllChatsListItem({ chat, active, ...prop }: Args) {
+ const title = chat.getTitle()
+
+ const ref = React.useRef(null)
+
+ return (
+
+ {title}
+
+
+ )
+}
diff --git a/client/ui/main-page/ContactsList.tsx b/client/ui/main-page/ContactsList.tsx
new file mode 100644
index 0000000..3168bc0
--- /dev/null
+++ b/client/ui/main-page/ContactsList.tsx
@@ -0,0 +1,164 @@
+import React from "react"
+import ContactsListItem from "./ContactsListItem.tsx"
+import { dialog, Dialog, TextField } from "mdui"
+
+interface Args extends React.HTMLAttributes {
+ display: boolean
+ openChatInfoDialog: (chat: Chat) => void
+ addContactDialogRef: React.MutableRefObject