Remove map

This commit is contained in:
Joshen Lim committed 2023-03-16 14:58:56 +08:00
1 parent 7a46fb2b4d
commit cd489fef11
1 file changed
+19 -20
@@ -81,26 +81,25 @@ const ItemContextMenu: FC<Props> = ({ id = '' }) => {
</Item>
</Submenu>
)}
{canUpdateFiles &&
[
<Item key="rename-file" onClick={({ props }) => onHandleClick('rename', props.item)}>
<IconEdit size="tiny" />
<span className="ml-2 text-xs">Rename</span>
</Item>,
<Item key="move-file" onClick={({ props }) => onHandleClick('move', props.item)}>
<IconMove size="tiny" />
<span className="ml-2 text-xs">Move</span>
</Item>,
<Item key="download-file" onClick={({ props }) => onHandleClick('download', props.item)}>
<IconDownload size="tiny" />
<span className="ml-2 text-xs">Download</span>
</Item>,
<Separator />,
<Item key="delete-file" onClick={({ props }) => setSelectedItemsToDelete([props.item])}>
<IconTrash2 size="tiny" />
<span className="ml-2 text-xs">Delete</span>
</Item>,
].map((x) => x)}
{canUpdateFiles && [
<Item key="rename-file" onClick={({ props }) => onHandleClick('rename', props.item)}>
<IconEdit size="tiny" />
<span className="ml-2 text-xs">Rename</span>
</Item>,
<Item key="move-file" onClick={({ props }) => onHandleClick('move', props.item)}>
<IconMove size="tiny" />
<span className="ml-2 text-xs">Move</span>
</Item>,
<Item key="download-file" onClick={({ props }) => onHandleClick('download', props.item)}>
<IconDownload size="tiny" />
<span className="ml-2 text-xs">Download</span>
</Item>,
<Separator />,
<Item key="delete-file" onClick={({ props }) => setSelectedItemsToDelete([props.item])}>
<IconTrash2 size="tiny" />
<span className="ml-2 text-xs">Delete</span>
</Item>,
]}
</Menu>
)
}