[PULSE-55] In-app notification center, settings tab, and notifications page #28

Merged
uz1mani merged 13 commits from staging into main 2026-02-16 19:46:02 +00:00
6 changed files with 295 additions and 719 deletions
Showing only changes of commit 43d40e5735 - Show all commits

View File

@@ -52,6 +52,8 @@ function getTypeIcon(type: string) {
return <CheckCircleIcon className="w-4 h-4 shrink-0 text-emerald-500" />
}
const LOADING_DELAY_MS = 250
export default function NotificationCenter() {
const [open, setOpen] = useState(false)
const [notifications, setNotifications] = useState<Notification[]>([])
@@ -61,8 +63,8 @@ export default function NotificationCenter() {
const dropdownRef = useRef<HTMLDivElement>(null)
const fetchNotifications = async () => {
setLoading(true)
setError(null)
const loadingTimer = setTimeout(() => setLoading(true), LOADING_DELAY_MS)
try {
const res = await listNotifications()
setNotifications(Array.isArray(res?.notifications) ? res.notifications : [])
@@ -72,6 +74,7 @@ export default function NotificationCenter() {
setNotifications([])
setUnreadCount(0)
} finally {
clearTimeout(loadingTimer)
setLoading(false)
}
}