feat: implement media download functionality and enhance case handling in reports
This commit is contained in:
@@ -11,3 +11,14 @@ export const formatFileSize = (bytes) => {
|
||||
|
||||
return `${formattedSize} ${sizes[i]}`
|
||||
}
|
||||
|
||||
export const downloadFiles = (files) => {
|
||||
files.forEach((file) => {
|
||||
const link = document.createElement('a')
|
||||
link.href = file.url
|
||||
link.download = file.filename || ''
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user