
export const downloadExcel = (res,name)=>{
  if (!res) return
  const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
  let filename = `${name}.xlsx`
  let url = window.URL.createObjectURL(blob)
  let aLink = document.createElement('a')
  aLink.style.display = 'none'
  aLink.href = url
  aLink.setAttribute('download', filename)
  document.body.appendChild(aLink)
  aLink.click()
  document.body.removeChild(aLink)
  window.URL.revokeObjectURL(url)
}