- {[
- { text: "New lead assigned to you", time: "5m ago" },
- { text: "Lead status updated to Closed", time: "1h ago" },
- { text: "Note added to Brightwave Studios", time: "3h ago" },
- ].map((n, i) => (
-
-
-
-
{n.text}
-
{n.time}
+ {notifications.length === 0 ? (
+
+ No notifications
+
+ ) : (
+
+ {notifications.slice(0, 20).map((n) => (
+
{
+ if (!n.read) markAsRead(n.id)
+ if (n.link) router.push(n.link)
+ }}
+ className={`flex cursor-pointer items-start gap-3 rounded-lg p-2 transition-colors hover:bg-muted/50 ${!n.read ? "bg-muted/30" : ""}`}
+ >
+
+
+
{n.title}
+
{n.description}
+
+ {formatTimeAgo(n.timestamp)}
+
+
+
-
- ))}
-
+ ))}
+
+ )}
@@ -119,7 +195,9 @@ export function Topbar({ onMenuClick }: TopbarProps) {
{initials}
-
{user.name}
+
+ {user.name}
+
@@ -127,7 +205,12 @@ export function Topbar({ onMenuClick }: TopbarProps) {
{user.name}
{user.email}
-
{user.role}
+
+ {user.role}
+
@@ -148,5 +231,5 @@ export function Topbar({ onMenuClick }: TopbarProps) {