@@ -4,8 +4,9 @@ import { Menu, Transition } from '@headlessui/react';
44import { FolderPlusIcon , PencilSquareIcon , TrashIcon } from '@heroicons/react/24/outline' ;
55import { EllipsisVerticalIcon } from '@heroicons/react/20/solid' ;
66import { DirectoryOptionsActions } from 'constants/WorkspaceDirectory' ;
7+ import { OBJ_TYPES } from 'constants/Common' ;
78
8- const OptionsMenu = ( { directory, itemType } ) => {
9+ const OptionsMenu = ( { collectionId , directory, itemType } ) => {
910 const menuItemsStyles =
1011 'group flex w-full items-center rounded px-2 py-2 text-sm text-gray-900 transition duration-200 ease-out hover:bg-slate-100' ;
1112 return (
@@ -43,6 +44,7 @@ const OptionsMenu = ({ directory, itemType }) => {
4344 data-options-menu-item = { DirectoryOptionsActions . addNewFolder . value }
4445 data-path-name = { directory . pathname }
4546 data-item-type = { itemType }
47+ data-collection-id = { collectionId }
4648 >
4749 < FolderPlusIcon
4850 className = 'w-4 h-4 mr-2'
@@ -60,6 +62,7 @@ const OptionsMenu = ({ directory, itemType }) => {
6062 data-options-menu-item = { DirectoryOptionsActions . addNewFlow . value }
6163 data-path-name = { directory . pathname }
6264 data-item-type = { itemType }
65+ data-collection-id = { collectionId }
6366 >
6467 < PencilSquareIcon
6568 className = 'w-4 h-4 mr-2'
@@ -79,14 +82,17 @@ const OptionsMenu = ({ directory, itemType }) => {
7982 data-options-menu-item = { DirectoryOptionsActions . delete . value }
8083 data-path-name = { directory . pathname }
8184 data-item-type = { itemType }
85+ data-collection-id = { collectionId }
8286 >
8387 < TrashIcon
8488 className = 'w-4 h-4 mr-2'
8589 aria-hidden = 'true'
8690 data-click-from = 'options-menu'
8791 data-item-type = { itemType }
8892 />
89- { DirectoryOptionsActions . delete . displayValue }
93+ { itemType === OBJ_TYPES . collection
94+ ? DirectoryOptionsActions . remove . displayValue
95+ : DirectoryOptionsActions . delete . displayValue }
9096 </ button >
9197 </ Menu . Item >
9298 </ div >
0 commit comments