Context menu component for file manager operations, rendering a dropdown with context-sensitive actions based on file type and selection state. ## Key Components **`FileManagerContextMenu`** — Main exported component that wraps a `DropdownMenu` with file-specific actions. **Menu Actions** (conditionally shown): | Action | Icon | Condition | |--------|------|-----------| | `download` | `Download` | File type or has selection | | `copy` | `Copy` | Always visible | | `rename` | `Edit2` | Single item only (no selection) | | `cut` | `Scissors` | Always visible | | `delete` | `Trash2` | Always visible (with separator) | **Props** (`FileManagerContextMenuProps`): | Prop | Description | |------|-------------| | `open` / `onOpenChange` | Controlled open state | | `onAction` | Callback receiving the action key | | `fileType` | `'file'` or `'folder'` — affects available actions | | `hasSelection` | Hides `rename`, shows `download` for multi-select | | `trigger` | Optional custom trigger element | | `className` | Additional classes for the dropdown content | ## Usage Example ```typescript import { FileManagerContextMenu } from './file-manager-context-menu' function FileRow({ file }) { const [menuOpen, setMenuOpen] = React.useState(false) return ( { if (action === 'delete') deleteFile(file.id) if (action === 'rename') startRename(file.id) if (action === 'download') downloadFile(file.id) }} /> ) } ``` > The default trigger renders a `MoreHorizontal` icon button. Pass a custom `trigger` element to replace it. Click events use `stopPropagation` to prevent row selection conflicts.