/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import React from "react"; import { Link } from "react-router"; import { DefaultTabOutline, MoreHorizontalOutline, PinOutline } from "@makeplane/propel/icons"; // plane imports import { useTranslation } from "@plane/i18n"; import { Menu } from "@plane/propel/menu"; import { Tooltip } from "@makeplane/propel/components/tooltip"; import { cn } from "@plane/utils"; // local imports import type { TNavigationItem } from "./tab-navigation-root"; import type { TTabPreferences } from "./tab-navigation-utils"; type Props = { overflowItems: TNavigationItem[]; isActive: (item: TNavigationItem) => boolean; tabPreferences: TTabPreferences; onToggleDefault: (tabKey: string) => void; onShow: (tabKey: string) => void; }; /** * Overflow menu for tab navigation items * Displays items that don't fit in the visible area, with action icons * Shows "Eye" icon for user-hidden items, "Set as default" icon for all items */ export function TabNavigationOverflowMenu({ overflowItems, isActive, tabPreferences, onToggleDefault, onShow }: Props) { const { t } = useTranslation(); return ( } > {overflowItems.map((item) => { const itemIsActive = isActive(item); // isHidden = true only for user-hidden items (not space-constrained overflow) const isHidden = tabPreferences.hiddenTabs.includes(item.key); const isDefault = item.key === tabPreferences.defaultTab; return (
{t(item.i18n_key)}
{/* Show Eye icon ONLY for user-hidden items */} {isHidden && ( )}
); })}
); }