refactor: avatar_file_hash instead of avatar

This commit is contained in:
CrescentLeaf
2025-10-24 20:29:51 +08:00
parent bef6e88bf7
commit 72016c5da1
13 changed files with 40 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
import Chat from "../../api/client_data/Chat.ts"
import getUrlForFileByHash from "../../getUrlForFileByHash.ts"
import Avatar from "../Avatar.tsx"
import React from 'react'
@@ -8,7 +9,7 @@ interface Args extends React.HTMLAttributes<HTMLElement> {
}
export default function ContactsListItem({ contact, ...prop }: Args) {
const { id, title, avatar } = contact
const { id, title, avatar_file_hash } = contact
const ref = React.useRef<HTMLElement>(null)
return (
@@ -20,7 +21,7 @@ export default function ContactsListItem({ contact, ...prop }: Args) {
<span style={{
width: "100%",
}}>{title}</span>
<Avatar src={avatar as string} text={title} slot="icon" />
<Avatar src={getUrlForFileByHash(avatar_file_hash as string)} text={title} slot="icon" />
</mdui-list-item>
)
}