1 import { PASS_APP_NAME } from '@proton/shared/lib/constants';
2 import { base64StringToUint8Array } from '@proton/shared/lib/helpers/encoding';
4 export const createExportFile = (encrypted: boolean, data: string): { filename: string; blob: Blob } => {
5 const content = encrypted ? data : base64StringToUint8Array(data);
6 const timestamp = new Date().toISOString().split('T')[0];
9 filename: `${PASS_APP_NAME}_export_${timestamp}.${encrypted ? 'pgp' : 'zip'}`,
10 blob: new Blob([content], { type: encrypted ? 'application/zip' : 'data:text/plain;charset=utf-8;' }),