import type { ICnOSSUploadFile } from '../types/upload-file'; export const useShowUploadDownloadIcon = (params: { showDownload?: ((file: ICnOSSUploadFile) => boolean) | boolean; onDownload?: (file: ICnOSSUploadFile) => void; file: ICnOSSUploadFile; }) => { const { file, onDownload } = params; if (typeof params.showDownload === 'function') { return params.showDownload(file); } if (!params.showDownload) return false; const isUploading = file.status && ['idle', 'uploading'].includes(file.status); if (isUploading) return false; return Boolean(file.downloadUrl || file.url || onDownload); };