- {notifications.map((notification) => {
- const { icon, title } = getNotificationDetails(notification.type!);
- return (
-
-
-
-
-
{title}
-
{notification.message}
-
-
-
- );
- })}
+ {unauthorized ? (
+
+
+
+ You are not authorized to view these notifications.
+
+
+ ) : notifications && notifications.length > 0 ? (
+ <>
+ {notifications.map((notification) => {
+ const { icon, title } = getNotificationDetails(notification.type!)
+ return (
+
+
+
+
+
+
{title}
+
{notification.message}
+
+
+ handleClearSingleNotification(notification._id!)}
+ iconPlacement="left"
+ Icon={Trash2Icon}
+ className="text-muted-foreground hover:text-primary w-20"
+ >
+ Clear
+
+
+
+
+ )
+ })}
+ >
+ ) : (
+
+
+
+ You're all caught up! No new notifications.
+
+
+ )}
+