diff --git a/frontend/components/layout/topbar.tsx b/frontend/components/layout/topbar.tsx index 9aca58ee..d19137fe 100644 --- a/frontend/components/layout/topbar.tsx +++ b/frontend/components/layout/topbar.tsx @@ -4,6 +4,7 @@ import { useRouter, usePathname } from "next/navigation"; import { useState, useRef, useEffect } from "react"; import { Menu, User, ChevronDown } from "lucide-react"; import { useAuthStore } from "@/store/auth.store"; +import { NotificationBell } from "@/opsce/features/notifications/NotificationBell"; const pageTitles: Record = { "/dashboard": "Dashboard", @@ -69,6 +70,9 @@ export function Topbar({ onMenuClick }: TopbarProps) { + {/* Notifications */} + + {/* Right: user dropdown */}
+ + {isOpen && ( +
+ {/* Header */} +
+
+

Notifications

+ {unreadCount > 0 && ( + + {unreadCount} new + + )} +
+
+ {unreadCount > 0 && ( + + )} + +
+
+ + {/* Connection status */} +
+ + + {isConnected ? 'Connected' : 'Disconnected'} + +
+ + {/* Notifications list */} +
+ {notifications.length === 0 ? ( +
+ No notifications yet +
+ ) : ( + notifications.map((notification) => ( +
markAsRead(notification.id)} + > +
+ + {typeIcons[notification.type] || '📋'} + +
+
+

+ {notification.title} +

+ {notification.priority === 'high' && ( + + )} +
+

{notification.message}

+

+ {format(new Date(notification.createdAt), 'MMM d, h:mm a')} +

+
+
+
+ )) + )} +
+ + {/* Footer */} + {notifications.length > 5 && ( +
+ +
+ )} +
+ )} +
+ ); +}