diff --git a/src/components/overlays/NotificationModal.tsx b/src/components/overlays/NotificationModal.tsx
index b25f4de5..e9e2bfda 100644
--- a/src/components/overlays/NotificationModal.tsx
+++ b/src/components/overlays/NotificationModal.tsx
@@ -30,29 +30,47 @@ function DetailView({
getCategoryColor,
getCategoryLabel,
formatDate,
+ isRead,
+ toggleReadStatus,
}: {
selectedNotification: NotificationItem;
goBackToList: () => void;
getCategoryColor: (category: string) => string;
getCategoryLabel: (category: string) => string;
formatDate: (dateString: string) => string;
+ isRead: boolean;
+ toggleReadStatus: () => void;
}) {
return (
- {/* Header with back button */}
-
+ {/* Header with back button and toggle read status */}
+
+
+
+
{/* Notification content */}
-
+
{getCategoryColor(selectedNotification.category) && (
{notifications.length === 0 ? (
@@ -237,17 +255,31 @@ function ListView({
>
-
-
- {notification.title}
-
- {!isRead && (
-
- )}
+
+
+
+ {notification.title}
+
+ {!isRead && (
+
+ )}
+
+
+ {getCategoryColor(notification.category) && (
+
+ )}
+
+ {getCategoryLabel(notification.category)}
+
+
{notification.description
@@ -256,19 +288,6 @@ function ListView({
{notification.description.length > 150 ? "..." : ""}
-
-
- {getCategoryColor(notification.category) && (
-
- )}
-
- {getCategoryLabel(notification.category)}
-
-
@@ -642,6 +661,22 @@ export function NotificationModal({ id }: NotificationModalProps) {
getCategoryColor={getCategoryColor}
getCategoryLabel={getCategoryLabel}
formatDate={formatDate}
+ isRead={readNotifications.has(selectedNotification.guid)}
+ toggleReadStatus={() => {
+ if (readNotifications.has(selectedNotification.guid)) {
+ // Mark as unread
+ const newReadSet = new Set(readNotifications);
+ newReadSet.delete(selectedNotification.guid);
+ setReadNotifications(newReadSet);
+ localStorage.setItem(
+ "read-notifications",
+ JSON.stringify(Array.from(newReadSet)),
+ );
+ } else {
+ // Mark as read
+ markAsRead(selectedNotification.guid);
+ }
+ }}
/>
) : null}