diff --git a/web/src/routes/dashboard/notifications/+page.svelte b/web/src/routes/dashboard/notifications/+page.svelte index 28c6058..47f728e 100644 --- a/web/src/routes/dashboard/notifications/+page.svelte +++ b/web/src/routes/dashboard/notifications/+page.svelte @@ -2,6 +2,11 @@ import { onMount } from 'svelte'; import { env } from '$env/dynamic/public'; import { Button } from '$lib/components/ui/button/index.js'; + import {Separator} from "$lib/components/ui/separator"; + import * as Sidebar from '$lib/components/ui/sidebar/index.js'; + import * as Breadcrumb from '$lib/components/ui/breadcrumb/index.js'; + import { Check } from 'lucide-svelte'; + const apiUrl = env.PUBLIC_API_URL; interface NotificationResponse { @@ -63,7 +68,6 @@ }); if (response.ok) { - // Move from unread to read const notification = unreadNotifications.find((n) => n.id === notificationId); if (notification) { notification.read = true; @@ -87,7 +91,6 @@ }); if (response.ok) { - // Move from read to unread const notification = readNotifications.find((n) => n.id === notificationId); if (notification) { notification.read = false; @@ -166,36 +169,9 @@ return date.toLocaleDateString(); } - function getNotificationIcon(message: string): string { - const lowerMessage = message.toLowerCase(); - - if (lowerMessage.includes('downloaded') || lowerMessage.includes('successfully')) { - return '✅'; - } - if ( - lowerMessage.includes('error') || - lowerMessage.includes('failed') || - lowerMessage.includes('failure') - ) { - return '❌'; - } - if (lowerMessage.includes('missing') || lowerMessage.includes('not found')) { - return '⚠️'; - } - if (lowerMessage.includes('api')) { - return '🔌'; - } - if (lowerMessage.includes('indexer')) { - return '🔍'; - } - - return '📢'; - } - onMount(() => { fetchNotifications(); - // Refresh notifications every 30 seconds const interval = setInterval(fetchNotifications, 30000); return () => clearInterval(interval); }); @@ -205,20 +181,42 @@
All caught up!
No unread notifications
{notification.message} @@ -269,6 +264,8 @@ onclick={() => markAsRead(notification.id)} class="rounded-lg p-2 text-blue-600 transition-colors hover:bg-blue-100 dark:hover:bg-blue-800" title="Mark as read" + variant="outline" + > -
{notification.message} @@ -354,6 +334,7 @@ onclick={() => markAsUnread(notification.id)} class="rounded-lg p-2 text-blue-600 transition-colors hover:bg-blue-100 dark:hover:bg-blue-800" title="Mark as unread" + variant="outline" > -