import { Virtuoso } from "react-virtuoso"; import { 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 { forwardRef } from "react"; import { DateTimeFormat } from "../../utils/DateFormatter.jsx"; const { Text, Title } = Typography; /** * Notification Center Component * @type {React.ForwardRefExoticComponent & React.RefAttributes>} */ const NotificationCenterComponent = forwardRef( ( { visible, onClose, notifications, loading, showUnreadOnly, toggleUnreadOnly, markAllRead, loadMore, onNotificationClick, unreadCount }, ref ) => { const { t } = useTranslation(); const navigate = useNavigate(); const renderNotification = (index, notification) => { const handleClick = () => { if (!notification.read) { onNotificationClick(notification.id); } navigate(`/manage/jobs/${notification.jobid}`); }; return (
<span className="ro-number"> {t("notifications.labels.ro-number", { ro_number: notification.roNumber })} </span> <Text type="secondary" className="relative-time" title={DateTimeFormat(notification.created_at)}> {day(notification.created_at).fromNow()} </Text>
    {notification.scenarioText.map((text, idx) => (
  • {text}
  • ))}
); }; return (

{t("notifications.labels.notification-center")}

{loading && }
{showUnreadOnly ? ( ) : ( )} toggleUnreadOnly(checked)} size="small" />
); } ); export default NotificationCenterComponent;