From e3a4c4f564a49ba750ba2630b92798ea7b32c294 Mon Sep 17 00:00:00 2001 From: NotII <46204250+NotII@users.noreply.github.com> Date: Fri, 7 Mar 2025 02:04:03 +0000 Subject: [PATCH] Update ChatNotifications.tsx --- components/dashboard/ChatNotifications.tsx | 95 +++++++++++----------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/components/dashboard/ChatNotifications.tsx b/components/dashboard/ChatNotifications.tsx index 0b107c5..8897dca 100644 --- a/components/dashboard/ChatNotifications.tsx +++ b/components/dashboard/ChatNotifications.tsx @@ -160,61 +160,64 @@ export default function ChatNotifications() { router.push(`/dashboard/chats/${chatId}`); }; - if (loading || unreadCounts.totalUnread === 0) { - return ( - - ); - } - return ( -
-

Unread Messages

-
-
- {Object.entries(unreadCounts.chatCounts).map(([chatId, count]) => ( - handleChatClick(chatId)} - > -
-
-

- Customer {chatMetadata[chatId]?.buyerId.slice(-4) || 'Unknown'} -

-

- {count} new {count === 1 ? 'message' : 'messages'} -

-
- {count} -
-
- ))} -
-
- +

Messages

+ + {unreadCounts.totalUnread === 0 ? ( +
+

No new notifications

+
+ ) : ( + <> +
+ {Object.entries(unreadCounts.chatCounts).map(([chatId, count]) => ( + handleChatClick(chatId)} + > +
+
+

+ Customer {chatMetadata[chatId]?.buyerId.slice(-4) || 'Unknown'} +

+

+ {count} new {count === 1 ? 'message' : 'messages'} +

+
+ {count} +
+
+ ))} +
+
+ +
+ + )}
);