diff --git a/frontend/src/components/NotificationDropdown.tsx b/frontend/src/components/NotificationDropdown.tsx index 4b509dd..6e9befa 100644 --- a/frontend/src/components/NotificationDropdown.tsx +++ b/frontend/src/components/NotificationDropdown.tsx @@ -1,7 +1,7 @@ import React, { useState, useRef, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import { Bell, Check, CheckCheck, Trash2, X, Ticket, Calendar, MessageSquare } from 'lucide-react'; +import { Bell, Check, CheckCheck, Trash2, X, Ticket, Calendar, MessageSquare, Clock } from 'lucide-react'; import { useNotifications, useUnreadNotificationCount, @@ -56,6 +56,13 @@ const NotificationDropdown: React.FC = ({ variant = ' } } + // Handle time-off request notifications - navigate to time blocks page + if (notification.data?.type === 'time_off_request') { + navigate('/time-blocks'); + setIsOpen(false); + return; + } + // Navigate to target if available if (notification.target_url) { navigate(notification.target_url); @@ -71,8 +78,13 @@ const NotificationDropdown: React.FC = ({ variant = ' clearAllMutation.mutate(); }; - const getNotificationIcon = (targetType: string | null) => { - switch (targetType) { + const getNotificationIcon = (notification: Notification) => { + // Check for time-off request type in data + if (notification.data?.type === 'time_off_request') { + return ; + } + + switch (notification.target_type) { case 'ticket': return ; case 'event': @@ -171,7 +183,7 @@ const NotificationDropdown: React.FC = ({ variant = ' >
- {getNotificationIcon(notification.target_type)} + {getNotificationIcon(notification)}