/**
 * Helper function to download blob as file
 * @param blob - The blob data
 * @param filename - The filename for download
 * @param contentType - The MIME type of the file
 */
export function downloadFile(blob: Blob, filename: string, contentType?: string): void {
  // Create blob URL
  const url = window.URL.createObjectURL(new Blob([blob], { type: contentType }));
  
  // Create temporary link element
  const link = document.createElement("a");
  link.href = url;
  link.setAttribute("download", filename);
  
  // Append to body and click
  document.body.appendChild(link);
  link.click();
  
  // Cleanup
  link.remove();
  window.URL.revokeObjectURL(url);
}