import React from "react"; import { ArrowLeft, CheckCheck, Clock, ListFilter, MoreVertical, RefreshCw, X } from "lucide-react"; // components import { ArchiveIcon, CustomMenu, Tooltip } from "@plane/ui"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; // ui // hooks import { ARCHIVED_NOTIFICATIONS, NOTIFICATIONS_READ, SNOOZED_NOTIFICATIONS, UNREAD_NOTIFICATIONS, } from "constants/event-tracker"; import { getNumberCount } from "helpers/string.helper"; import { useEventTracker } from "hooks/store"; import { usePlatformOS } from "hooks/use-platform-os"; // helpers // type import type { NotificationType, NotificationCount } from "@plane/types"; // constants 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(); // hooks const { isMobile } = usePlatformOS(); 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 ? ( ) : ( )}
); };