refactor(ChatsCard): enhance layout and styling for better responsiveness

- Updated the ChatsCard component to improve layout and styling, ensuring better responsiveness.
- Adjusted class names for flex properties and truncation to enhance visual presentation of chat details.
- Ensured proper handling of unread message indicators and improved the rendering of last message timestamps.
This commit is contained in:
AmirReza Jamali
2026-04-15 13:06:44 +03:30
parent 5a96dd2341
commit e45b96a506
+11 -6
View File
@@ -38,25 +38,30 @@ export async function ChatsCard() {
/> />
</div> </div>
<div className="relative flex-grow"> <div
<h3 className="font-medium text-dark dark:text-white"> className={cn(
"relative flex-grow min-w-0",
chat.unreadCount && "pr-10",
)}
>
<h3 className="truncate font-medium text-dark dark:text-white">
{chat.name} {chat.name}
</h3> </h3>
<div className="flex flex-wrap items-center gap-2"> <div className="flex min-w-0 items-center gap-2">
<span <span
className={cn( className={cn(
"truncate text-sm font-medium dark:text-dark-5 xl:max-w-[8rem]", "block min-w-0 flex-1 truncate text-sm font-medium dark:text-dark-5",
chat.unreadCount && "text-dark-4 dark:text-dark-6", chat.unreadCount && "text-dark-4 dark:text-dark-6",
)} )}
> >
{chat.lastMessage.content} {chat.lastMessage.content}
</span> </span>
<DotIcon /> <DotIcon className="shrink-0" />
<time <time
className="text-xs" className="shrink-0 text-xs"
dateTime={chat.lastMessage.timestamp} dateTime={chat.lastMessage.timestamp}
> >
{formatMessageTime(chat.lastMessage.timestamp)} {formatMessageTime(chat.lastMessage.timestamp)}