import { formatTime } from "@/utils"; import CustomLink from "@/components/Common/CustomLink"; import CustomImage from "@/components/Common/CustomImage"; const ChatListCard = ({ chat, isSelling, isActive, handleChatTabClick }) => { const user = isSelling ? chat?.buyer : chat?.seller; const isUnread = chat?.unread_chat_count > 0; return ( handleChatTabClick(chat, isSelling)} className={`py-3 px-4 border-b flex items-center gap-4 cursor-pointer ${ isActive ? "bg-primary text-white" : "" }`} >
{user?.name}
{formatTime(chat?.last_message_time)}

{chat?.item?.translated_name || chat?.item?.name}

{isUnread && !isActive && ( {chat?.unread_chat_count} )}
); }; export default ChatListCard;