refactor: 解耦側邊列表

This commit is contained in:
CrescentLeaf
2025-09-14 14:33:04 +08:00
parent 85b48475de
commit ee670f86b6
4 changed files with 92 additions and 91 deletions

View File

@@ -0,0 +1,31 @@
import RecentChat from "../../api/client_data/RecentChat.ts"
import User from "../../api/client_data/User.ts"
import ContactsListItem from "./ContactsListItem.jsx"
import RecentsListItem from "./RecentsListItem.jsx"
interface Args extends React.HTMLAttributes<HTMLElement> {
recentsList: RecentChat[]
display: boolean
}
export default function RecentsList({
recentsList,
display,
...props
}: Args) {
return <mdui-list style={{
overflowY: 'auto',
paddingRight: '10px',
display: display ? undefined : 'none'
}}>
{
recentsList.map((v) =>
<RecentsListItem
key={v.id}
nickName={v.title}
avatar={v.avatar}
content={v.content} />
)
}
</mdui-list>
}