import { useEffect, useRef } from "react"; import { useUserStore } from "../../stores/user"; import { useNotificationsStore } from "../../stores/notifications"; import { NoteCard } from "../feed/NoteCard"; export function NotificationsView() { const { pubkey, loggedIn } = useUserStore(); const { notifications, unreadCount, lastSeenAt, loading, fetchNotifications, markAllRead, } = useNotificationsStore(); // Capture lastSeenAt at mount time so unread highlights persist during this view session const prevLastSeenAtRef = useRef(lastSeenAt); useEffect(() => { if (!pubkey) return; fetchNotifications(pubkey).then(() => { setTimeout(() => markAllRead(), 500); }); }, [pubkey]); if (!loggedIn || !pubkey) { return (