import { cn } from "~/lib/utils"; import { Bell, AlertTriangle, TrendingUp, TrendingDown, Wallet, Fish, X, Check } from "lucide-react"; import { Button } from "@/routes/ui/button"; export interface Notification { id: string; type: "price_alert" | "whale_activity" | "rug_warning" | "portfolio" | "news"; priority: "high" | "medium" | "low"; title: string; message: string; tokenSymbol?: string; timestamp: Date; read: boolean; actionUrl?: string; } export interface NotificationsListProps { notifications: Notification[]; onMarkRead: (id: string) => void; onMarkAllRead: () => void; onDismiss: (id: string) => void; onNotificationClick?: (notification: Notification) => void; className?: string; } const getNotificationIcon = (type: Notification["type"]) => { switch (type) { case "price_alert": return ; case "whale_activity": return ; case "rug_warning": return ; case "portfolio": return ; case "news": return ; default: return ; } }; const getPriorityColor = (priority: Notification["priority"]) => { switch (priority) { case "high": return "border-l-red-500 bg-red-500/5"; case "medium": return "border-l-yellow-500 bg-yellow-500/5"; case "low": return "border-l-muted-foreground bg-muted/30"; default: return "border-l-muted-foreground"; } }; const formatTime = (date: Date): string => { const now = new Date(); const diff = now.getTime() - date.getTime(); const minutes = Math.floor(diff / 60000); const hours = Math.floor(diff / 3600000); const days = Math.floor(diff / 86400000); if (minutes < 1) return "Just now"; if (minutes < 60) return `${minutes}m ago`; if (hours < 24) return `${hours}h ago`; return `${days}d ago`; }; /** * NotificationsList - Display and manage notifications * Part of Epic 4.4 - Smart Notifications */ export function NotificationsList({ notifications, onMarkRead, onMarkAllRead, onDismiss, onNotificationClick, className, }: NotificationsListProps) { const unreadCount = notifications.filter((n) => !n.read).length; return (
{/* Header */}
Notifications {unreadCount > 0 && ( {unreadCount} )}
{unreadCount > 0 && ( )}
{/* Notifications List */}
{notifications.length === 0 ? (

No notifications yet

) : ( notifications.map((notification) => (
{ if (!notification.read) onMarkRead(notification.id); onNotificationClick?.(notification); }} >
{getNotificationIcon(notification.type)}
{notification.title} {notification.tokenSymbol && ( {notification.tokenSymbol} )}

{notification.message}

{formatTime(notification.timestamp)}
)) )}
); }