Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / applications / drive / src / app / components / sections / Search / SearchItemContextMenu.tsx
blob54b7d332d8a3b1f36ec1826235d260e813691cca
1 import { ContextSeparator } from '@proton/components';
2 import type { SHARE_MEMBER_PERMISSIONS } from '@proton/shared/lib/drive/permissions';
4 import type { DecryptedLink } from '../../../store';
5 import type { ContextMenuProps } from '../../FileBrowser/interface';
6 import { DriveItemContextMenu } from '../Drive/DriveContextMenu';
7 import { GoToParent } from './ContextMenuButtons';
9 export function SearchItemContextMenu(
10     props: ContextMenuProps & {
11         shareId: string;
12         selectedLinks: DecryptedLink[];
13         permissions: SHARE_MEMBER_PERMISSIONS;
14     }
15 ) {
16     const { shareId, selectedLinks, close } = props;
18     const isOnlyOneItem = selectedLinks.length === 1;
20     return (
21         <DriveItemContextMenu {...props}>
22             {isOnlyOneItem && (
23                 <>
24                     <ContextSeparator />
25                     <GoToParent shareId={shareId} parentLinkId={selectedLinks[0].parentLinkId} close={close} />
26                 </>
27             )}
28         </DriveItemContextMenu>
29     );