fixed image and name chat

This commit is contained in:
SlimusMinus
2026-08-13 00:37:41 +03:00
parent 6b1b41d423
commit 66ff0dc5bf
6 changed files with 70 additions and 13 deletions

View File

@@ -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 && (