import { Button } from '@/components/ui/button' import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { Eye, Download, Share2, Pencil, FolderInput, Trash2, RotateCcw } from 'lucide-react' const ActionButton = ({ icon: Icon, children, destructive = false, ...props }) => ( ) export default function ItemActionsDialog({ controller: c }) { const { modal, setModal, action, handleAction, isTrash, view } = c const rights = new Set(action?.permissions || []) return ( { if (!open) setModal(null) }}> {action?.name || 'Actions'} Choisir une action sur cet élément.
{action && <> {!isTrash && handleAction('open')}>Ouvrir} {!action.is_folder && rights.has('download') && handleAction('download')}>Télécharger} {!isTrash && rights.has('share') && handleAction('share')}>Partager} {!isTrash && rights.has('modify') && <> handleAction('rename')}>Renommer handleAction('move')}>Déplacer } {!isTrash && view === 'shared' && action.share_root_id && handleAction('remove-share')}>Retirer de mes partages} {!isTrash && view !== 'shared' && rights.has('delete') && handleAction('trash')}>Corbeille} {rights.has('delete') && isTrash && <> handleAction('restore')}>Restaurer handleAction('confirmdelete')}>Supprimer } }
) }