import { X, ExternalLink } from 'lucide-react'; import { NotificationMessageType, NotificationStatus, type Notification, } from '@domain/entities'; import { useTranslation } from '@/i18n/TranslationProvider'; interface NotificationPanelProps { isOpen: boolean; onClose: () => void; notifications: Notification[]; onMarkAsRead: (notificationId: string) => void; onMarkAllRead?: () => void; } function getMessageTypeColors(messageType: NotificationMessageType): { bg: string; border: string; text: string; } { switch (messageType) { case NotificationMessageType.URGENT_QUESTION: return { bg: 'bg-red-50', border: 'border-red-200', text: 'text-red-700' }; case NotificationMessageType.QUESTION: return { bg: 'bg-purple-50', border: 'border-purple-200', text: 'text-purple-700' }; case NotificationMessageType.WAITING_ACTION: return { bg: 'bg-orange-50', border: 'border-orange-200', text: 'text-orange-700' }; case NotificationMessageType.INFO: return { bg: 'bg-cyan-50', border: 'border-cyan-200', text: 'text-cyan-700' }; default: return { bg: 'bg-gray-50', border: 'border-gray-200', text: 'text-gray-700' }; } } function getMessageTypeLabel(messageType: NotificationMessageType, t: (key: string) => string): string { switch (messageType) { case NotificationMessageType.QUESTION: return t('notifications.question'); case NotificationMessageType.WAITING_ACTION: return t('notifications.waitingAction'); case NotificationMessageType.URGENT_QUESTION: return t('notifications.urgentQuestion'); case NotificationMessageType.INFO: return t('notifications.info'); default: return t('notifications.notification'); } } export function NotificationPanel({ isOpen, onClose, notifications, onMarkAsRead, onMarkAllRead, }: NotificationPanelProps) { const { t } = useTranslation(); if (!isOpen) return null; const unreadNotifications = notifications.filter( (n) => n.status !== NotificationStatus.READ && n.status !== NotificationStatus.ARCHIVED, ); return ( <> {/* Backdrop */}