From 8d512f665ed1e5cc20ab3e43f82e2f33f1a9eea0 Mon Sep 17 00:00:00 2001 From: maxDorninger <97409287+maxDorninger@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:54:23 +0200 Subject: [PATCH] add notifications to frontend --- web/src/lib/components/app-sidebar.svelte | 23 +- web/src/lib/types.ts | 7 + .../dashboard/notifications/+page.svelte | 357 ++++++++++++++++++ 3 files changed, 375 insertions(+), 12 deletions(-) create mode 100644 web/src/routes/dashboard/notifications/+page.svelte diff --git a/web/src/lib/components/app-sidebar.svelte b/web/src/lib/components/app-sidebar.svelte index d533f95..371a25f 100644 --- a/web/src/lib/components/app-sidebar.svelte +++ b/web/src/lib/components/app-sidebar.svelte @@ -1,5 +1,5 @@ + + + Notifications - MediaManager + + +
+
+

Notifications

+ {#if unreadNotifications.length > 0} + + {/if} +
+ + {#if loading} +
+
+
+ {:else} + +
+
+

+ Unread Notifications +

+ {#if unreadNotifications.length > 0} + + {unreadNotifications.length} + + {/if} +
+ + {#if unreadNotifications.length === 0} +
+
+

All caught up!

+

No unread notifications

+
+ {:else} +
+ {#each unreadNotifications as notification (notification.id)} +
+
+
+ {getNotificationIcon(notification.message)} +
+

+ {notification.message} +

+

+ {formatTimestamp(notification.timestamp)} +

+
+
+
+ + +
+
+
+ {/each} +
+ {/if} +
+ + +
+ +
+ + + {#if showRead} +
+ {#if readNotifications.length === 0} +
+

No read notifications

+
+ {:else} +
+ {#each readNotifications as notification (notification.id)} +
+
+
+ {getNotificationIcon(notification.message)} +
+

+ {notification.message} +

+

+ {formatTimestamp(notification.timestamp)} +

+
+
+
+ + +
+
+
+ {/each} +
+ {/if} +
+ {/if} + {/if} +