export const downLoadUrl = (url, name) => {
  const a = document.createElement("a");
  fetch(url)
    .then((res) => res.blob())
    .then((bolb) => {
      a.href = URL.createObjectURL(bolb);
      a.download = name || "";
      document.body.appendChild(a);
      a.click();
    });
}

export const downLoadBlob = (data, name) => {
  let b = new Blob([data], { type: data.type })
  let link = document.createElement('a')
  link.href = window.URL.createObjectURL(b)
  link.download = name
  link.click()
}
