diff --git a/src/utils/getSvgContent.ts b/src/utils/getSvgContent.ts new file mode 100644 index 0000000..82d9b4b --- /dev/null +++ b/src/utils/getSvgContent.ts @@ -0,0 +1,7 @@ +export const MIMETYPE = 'text/plain'; +export const getSvgContent = async (url: string | undefined, isSupported: boolean) => { + const response = await fetch(url || ''); + const content = await response.text(); + const blob = new Blob([content], { type: MIMETYPE }); + return isSupported ? blob : content; +}; \ No newline at end of file