import React from "react"; import { ArrowLeft, CheckCheck, Clock, ListFilter, MoreVertical, RefreshCw, X } from "lucide-react"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; // ui import { ArchiveIcon, CustomMenu, Tooltip } from "@plane/ui"; // hooks import { useEventTracker } from "hooks/store"; // helpers import { getNumberCount } from "helpers/string.helper"; // type import type { NotificationType, NotificationCount } from "@plane/types"; // constants import { ARCHIVED_NOTIFICATIONS, NOTIFICATIONS_READ, SNOOZED_NOTIFICATIONS, UNREAD_NOTIFICATIONS, } from "constants/event-tracker"; type NotificationHeaderProps = { notificationCount?: NotificationCount | null; notificationMutate: () => void; closePopover: () => void; isRefreshing?: boolean; snoozed: boolean; archived: boolean; readNotification: boolean; selectedTab: NotificationType; setSnoozed: React.Dispatch>; setArchived: React.Dispatch>; setReadNotification: React.Dispatch>; setSelectedTab: React.Dispatch>; markAllNotificationsAsRead: () => Promise; }; export const NotificationHeader: React.FC = (props) => { const { notificationCount, notificationMutate, closePopover, isRefreshing, snoozed, archived, readNotification, selectedTab, setSnoozed, setArchived, setReadNotification, setSelectedTab, markAllNotificationsAsRead, } = props; // store hooks const { captureEvent } = useEventTracker(); const notificationTabs: Array<{ label: string; value: NotificationType; unreadCount?: number; }> = [ { label: "My Issues", value: "assigned", unreadCount: notificationCount?.my_issues, }, { label: "Created by me", value: "created", unreadCount: notificationCount?.created_issues, }, { label: "Subscribed", value: "watching", unreadCount: notificationCount?.watching_issues, }, ]; return ( <>

Notifications

} closeOnSelect > { markAllNotificationsAsRead(); captureEvent(NOTIFICATIONS_READ); }} >
Mark all as read
{ setArchived(false); setReadNotification(false); setSnoozed((prev) => !prev); captureEvent(SNOOZED_NOTIFICATIONS); }} >
Show snoozed
{ setSnoozed(false); setReadNotification(false); setArchived((prev) => !prev); captureEvent(ARCHIVED_NOTIFICATIONS); }} >
Show archived
{snoozed || archived || readNotification ? ( ) : ( )}
); };