mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 00:45:41 +00:00
feat: ui changes and pdf setup on the clients
This commit is contained in:
11
apps/edr-freight-web/portal/src/utils/download.ts
Normal file
11
apps/edr-freight-web/portal/src/utils/download.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/** Trigger a browser download of a Blob under `filename`. */
|
||||
export function saveBlob(blob: Blob, filename: string): void {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
Reference in New Issue
Block a user