'use client'; import { useState } from 'react'; import Image from 'next/image'; import Link from 'next/link'; // Mock notification data - replace with actual API call when backend is ready interface Notification { id: string; type: 'connection' | 'message' | 'system' | 'update'; title: string; description: string; timestamp: string; read: boolean; actionUrl?: string; avatar?: string; } const mockNotifications: Notification[] = [ { id: '1', type: 'connection', title: 'New Connection Request', description: 'John Smith wants to connect with you', timestamp: '2 hours ago', read: false, actionUrl: '/user/connections', }, { id: '2', type: 'message', title: 'New Message', description: 'You have a new message from Sarah Johnson', timestamp: '5 hours ago', read: false, actionUrl: '/user/message', }, { id: '3', type: 'system', title: 'Profile Update Reminder', description: 'Complete your profile to get better recommendations', timestamp: '1 day ago', read: true, actionUrl: '/user/settings', }, { id: '4', type: 'update', title: 'New Features Available', description: 'Check out the latest updates to our platform', timestamp: '3 days ago', read: true, }, ]; function getNotificationIcon(type: Notification['type']) { switch (type) { case 'connection': return '/assets/icons/user-placeholder-icon.svg'; case 'message': return '/assets/icons/message-icon.svg'; case 'system': return '/assets/icons/settings-icon.svg'; case 'update': return '/assets/icons/notification-bell-icon.svg'; default: return '/assets/icons/notification-bell-icon.svg'; } } export default function UserNotificationsPage() { const [notifications, setNotifications] = useState(mockNotifications); const [filter, setFilter] = useState<'all' | 'unread'>('all'); const filteredNotifications = filter === 'all' ? notifications : notifications.filter(n => !n.read); const unreadCount = notifications.filter(n => !n.read).length; const markAsRead = (id: string) => { setNotifications(prev => prev.map(n => n.id === id ? { ...n, read: true } : n) ); }; const markAllAsRead = () => { setNotifications(prev => prev.map(n => ({ ...n, read: true }))); }; return (
{/* Header */}
Notifications

Notifications

{unreadCount > 0 ? `You have ${unreadCount} unread notification${unreadCount > 1 ? 's' : ''}` : 'All caught up!'}

{unreadCount > 0 && ( )}
{/* Filter Tabs */}
{/* Notifications List */}
{filteredNotifications.length === 0 ? (
No notifications

{filter === 'unread' ? 'No unread notifications' : 'No notifications yet'}

) : (
{filteredNotifications.map((notification) => (
{/* Icon */}
{notification.type}
{/* Content */}

{notification.title}

{notification.description}

{notification.timestamp}
{/* Actions */}
{notification.actionUrl && ( View details )} {!notification.read && ( )}
{/* Unread indicator */} {!notification.read && (
)}
))}
)}
{/* Settings Link */}
Manage notification settings
); }