import { useTranslation } from "react-i18next"; import { Bookmark, BookmarkX, Check, Eye, EyeOff, RotateCcw, Undo2 } from "lucide-react"; import { type PlexCard, type Video, type VideoStatus } from "../lib/api"; import { isResettable } from "../lib/api/feed"; import { pinPlex, pinVideo, useComfortPin, type PinTarget } from "./comfortPin"; import { type ActionMenuItem } from "./ui/ActionMenu"; import { ContextMenu } from "./ui/ContextMenu"; import { type ContextMenuController } from "./ui/useContextMenu"; // The menu SURFACE for the comfort-shelf pin (E24 S3). Split from `comfortPin.tsx` for the same // reason `ContextMenu.tsx` is split from `useContextMenu.ts`: a file that exports components and // nothing else keeps react-refresh working for every surface that imports it. /** * The whole right-click menu for a surface whose only context action is the pin — the card grids and * rails. Render ONE per list, outside the rows (see `ui/ContextMenu`), and spread * `menu.triggerProps` on each row. * * `target` maps the row the user right-clicked to its pin; `title` names it in the confirmation * toast. Both come from the call site because only it knows what its rows are. */ export function ComfortPinMenu({ menu, target, title, }: { menu: ContextMenuController; target: (row: T) => PinTarget | null; title: (row: T) => string; }) { const { t } = useTranslation(); const pin = useComfortPin(menu.open); const row = menu.target; return ( ); } /** The Plex poster grids and rails — five of them, all pinning the same way. One component so the * show-vs-item decision and the toast's name are written once rather than five times. */ export function PlexPinMenu({ menu }: { menu: ContextMenuController }) { return c.title} />; } /** The feed's menu (the grid and a channel page): the card's own state actions — the hover row's * buttons, which a keyboard or a touch user otherwise reaches only by Tabbing through every card — * then the pin. Playlists and downloads stay on the card: each opens its own anchored dialog. */ export function FeedVideoMenu({ menu, onState, onToggleSave, onResetState, }: { menu: ContextMenuController