// src/utils/downloadBlob.ts // (Billing-Aware Export), Task 10 - tiny Blob -> anchor download helper, extracted from // downloadBundleJson.ts's inline Blob -> createObjectURL -> anchor-click -> revoke pattern (the only // other place in the codebase that triggers a client-side file download). BillingExportPage uses this // directly rather than repeating the pattern a third time; downloadBundleJson.ts itself is left as-is // (already deployed/verified for the B3 legal-export flow - not worth touching for this). export function downloadBlob(blob: Blob, filename: string): void { const url = URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; link.download = filename; document.body.appendChild(link); link.click(); document.body.removeChild(link); URL.revokeObjectURL(url); } export default downloadBlob;