diff --git a/components/notifications/UnifiedNotifications.tsx b/components/notifications/UnifiedNotifications.tsx index 6af0533..71e4358 100644 --- a/components/notifications/UnifiedNotifications.tsx +++ b/components/notifications/UnifiedNotifications.tsx @@ -307,59 +307,148 @@ export default function UnifiedNotifications() { )} - - - - - {totalNotifications === 0 ? ( -
-

No new notifications

-
- ) : ( -
- {/* Messages Section */} - {unreadCounts.totalUnread > 0 && ( - <> -
- Unread Messages -
- {Object.entries(unreadCounts.chatCounts).slice(0, 3).map(([chatId, count]) => ( - handleChatClick(chatId)} - > -
-
- -
-

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

-

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

-
-
- {count} + + + {totalNotifications === 0 ? ( +
+

No new notifications

+
+ ) : ( +
+ {/* Messages Section */} + {unreadCounts.totalUnread > 0 && ( + <> +
+ Unread Messages
- - ))} - {Object.keys(unreadCounts.chatCounts).length > 3 && ( -
- + {Object.keys(unreadCounts.chatCounts).length - 3} more unread chats -
+ {Object.entries(unreadCounts.chatCounts).slice(0, 3).map(([chatId, count]) => ( + handleChatClick(chatId)} + > +
+
+ +
+

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

+

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

+
+
+ {count} +
+
+ ))} + {Object.keys(unreadCounts.chatCounts).length > 3 && ( +
+ + {Object.keys(unreadCounts.chatCounts).length - 3} more unread chats +
+ )} + )} + + {/* Orders Section */} + {newOrders.length > 0 && ( + <> +
+ New Paid Orders + +
+ {newOrders.slice(0, 3).map((order) => ( + handleOrderClick(order._id)} + > +
+
+ +
+

Order #{order.orderId}

+

+ {formatPrice(order.totalPrice)} +

+
+
+ Paid +
+
+ ))} + {newOrders.length > 3 && ( +
+ + {newOrders.length - 3} more new orders +
+ )} + + )} +
+ )} +
+ + + {unreadCounts.totalUnread === 0 ? ( +
+

No 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} +
+
+ ))} +
+
+ +
)} - - {/* Divider if both types are present */} - {unreadCounts.totalUnread > 0 && newOrders.length > 0 && ( - - )} - - {/* Orders Section */} - {newOrders.length > 0 && ( +
+ + + {newOrders.length === 0 ? ( +
+

No new paid orders

+
+ ) : ( <>
New Paid Orders @@ -375,136 +464,42 @@ export default function UnifiedNotifications() { Clear
- {newOrders.slice(0, 3).map((order) => ( - handleOrderClick(order._id)} - > -
-
- -
-

Order #{order.orderId}

-

- {formatPrice(order.totalPrice)} -

+
+ {newOrders.map((order) => ( + handleOrderClick(order._id)} + > +
+
+ +
+

Order #{order.orderId}

+

+ {formatPrice(order.totalPrice)} +

+
+ Paid
- Paid -
- - ))} - {newOrders.length > 3 && ( -
- + {newOrders.length - 3} more new orders -
- )} + + ))} +
+
+ +
)} -
- )} - - - - {unreadCounts.totalUnread === 0 ? ( -
-

No 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} -
-
- ))} -
-
- -
- - )} -
- - - {newOrders.length === 0 ? ( -
-

No new paid orders

-
- ) : ( - <> -
- New Paid Orders - -
-
- {newOrders.map((order) => ( - handleOrderClick(order._id)} - > -
-
- -
-

Order #{order.orderId}

-

- {formatPrice(order.totalPrice)} -

-
-
- Paid -
-
- ))} -
-
- -
- - )} -
+ + +
);