This hook wraps file operation callbacks with loading state management and error handling. It tracks operation-in-progress states for UI feedback.
const {
isDeleting,
isRenaming,
handleDelete,
handleRename,
handleCreateFolder,
} = useFileOperations({
currentPath: '/',
callbacks: {
onDelete: fileCache.deleteFiles,
onRename: fileCache.renameFile,
onCreateFolder: fileCache.createFolder,
onRefresh: refreshFiles,
},
});
// Use in delete confirmation dialog
<DeleteConfirmDialog
onConfirm={() => handleDelete(selectedFiles)}
isDeleting={isDeleting}
/>
Hook for managing file operations.