fixed image and name chat
This commit is contained in:
@@ -2,7 +2,7 @@ import { getChatDisplayInfo } from "../../utils/chatDisplay";
|
||||
import TrashIcon from "../icons/TrashIcon";
|
||||
|
||||
export default function ChatListItem({ chat, post, unreadMap, t, onOpen, onDelete }) {
|
||||
const { title, imgSrc, emoji, unreadCount } = getChatDisplayInfo(chat, post, unreadMap, t);
|
||||
const { title, imgSrc, emoji, unreadCount, preview } = getChatDisplayInfo(chat, post, unreadMap, t);
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -13,13 +13,13 @@ export default function ChatListItem({ chat, post, unreadMap, t, onOpen, onDelet
|
||||
{imgSrc ? (
|
||||
<img src={imgSrc} alt="" className="chat-list-avatar-img" />
|
||||
) : (
|
||||
emoji || chat.otherUser?.name?.[0] || "?"
|
||||
emoji || chat.otherUserName?.[0] || chat.otherUser?.name?.[0] || "?"
|
||||
)}
|
||||
</div>
|
||||
<div className="chat-list-info">
|
||||
<div className="chat-list-name">{title}</div>
|
||||
<div className="chat-list-preview">
|
||||
{chat.lastMessage?.content || t('chat.noMessages')}
|
||||
{preview}
|
||||
</div>
|
||||
</div>
|
||||
{unreadCount > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user