11import { useState , useEffect } from 'react'
2- import { useNavigate } from 'react-router-dom'
2+ import { useLocation , useNavigate } from 'react-router-dom'
33import { useI18n } from 'twake-i18n'
44
55import { useClient } from 'cozy-client'
@@ -28,6 +28,7 @@ import { addToFavorites } from '@/modules/actions/components/addToFavorites'
2828import { duplicateTo } from '@/modules/actions/components/duplicateTo'
2929import { moveTo } from '@/modules/actions/components/moveTo'
3030import { removeFromFavorites } from '@/modules/actions/components/removeFromFavorites'
31+ import { details } from '@/modules/actions/details'
3132import { filterActionsByPolicy } from '@/modules/actions/policies'
3233
3334export const useMoreMenuActions = file => {
@@ -46,6 +47,7 @@ export const useMoreMenuActions = file => {
4647 const currentFolderId = useCurrentFolderId ( )
4748 const { isSharingShortcutCreated, addSharingLink, syncSharingLink } =
4849 useSharingInfos ( )
50+ const location = useLocation ( )
4951 const canWriteToCurrentFolder = hasWriteAccess ( currentFolderId , file . driveId )
5052 const isPDFDoc = file . mime === 'application/pdf'
5153 const showPrintAction = isPDFDoc && isPrintAvailable
@@ -60,6 +62,7 @@ export const useMoreMenuActions = file => {
6062 isCozySharing && syncToCozySharingLink ,
6163 download ,
6264 showPrintAction && print ,
65+ details ,
6366 hr ,
6467 moveTo ,
6568 ! isSharedDrive && duplicateTo , // TO DO: Remove condition when duplicating is available in shared drive
@@ -95,7 +98,8 @@ export const useMoreMenuActions = file => {
9598 fetchBlobFileById,
9699 isFile,
97100 addSharingLink,
98- driveId : file . driveId
101+ driveId : file . driveId ,
102+ location
99103 }
100104 )
101105
0 commit comments