import { Virtuoso } from "react-virtuoso"; import { Alert, Badge, Button, Space, Spin, Switch, Tooltip, Typography } from "antd"; import { CheckCircleFilled, CheckCircleOutlined, EyeFilled, EyeOutlined } from "@ant-design/icons"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import "./notification-center.styles.scss"; import day from "../../utils/day.js"; import { useEffect, useRef } from "react"; import { DateTimeFormat } from "../../utils/DateFormatter.jsx"; const { Text, Title } = Typography; /** * Notification Center Component */ const NotificationCenterComponent = ({ visible, notifications, loading, showUnreadOnly, toggleUnreadOnly, markAllRead, loadMore, onNotificationClick, unreadCount, isEmployee, isDarkMode, ref }) => { const { t } = useTranslation(); const navigate = useNavigate(); const virtuosoRef = useRef(null); // Scroll to top when showUnreadOnly changes useEffect(() => { if (virtuosoRef.current) { virtuosoRef.current.scrollToIndex({ index: 0, behavior: "smooth" }); } }, [showUnreadOnly]); const renderNotification = (index, notification) => { const handleClick = () => { if (!notification.read) { onNotificationClick(notification.id); } navigate(`/manage/jobs/${notification.jobid}`); }; return (