URL updates

This commit is contained in:
proddy
2024-09-28 21:01:37 +02:00
parent f096c1b632
commit a2e41d6d1e
16 changed files with 277 additions and 177 deletions

View File

@@ -0,0 +1,11 @@
export const saveFile = (json: unknown, filename: string, extension: string) => {
const anchor = document.createElement('a');
anchor.href = URL.createObjectURL(
new Blob([JSON.stringify(json, null, 2)], {
type: 'text/plain'
})
);
anchor.download = 'emsesp_' + filename + extension;
anchor.click();
URL.revokeObjectURL(anchor.href);
};