generated from VLADIMIR/template_frontend
add first custom component
This commit is contained in:
@@ -23,7 +23,7 @@ export const downloadData = (data: string) => {
|
||||
downloadFile(b, 'teams_qr_code.pdf', 'application/pdf;teams_qr_code.pdf')
|
||||
}
|
||||
|
||||
export const base64ToBytes = (base64: string): Uint8Array => {
|
||||
const base64ToBytes = (base64: string): Uint8Array => {
|
||||
const binaryString = atob(base64);
|
||||
const bytes = new Uint8Array(binaryString.length);
|
||||
for (let i = 0; i < binaryString.length; i++) {
|
||||
@@ -32,7 +32,7 @@ export const base64ToBytes = (base64: string): Uint8Array => {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
export const downloadFile = (bytes: Uint8Array, fileName: string, mimeType: string) => {
|
||||
const downloadFile = (bytes: Uint8Array, fileName: string, mimeType: string) => {
|
||||
const blob = new Blob([bytes], { type: mimeType });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
|
||||
Reference in New Issue
Block a user