🛠️ Implement SVG optimization utility and update getSource function to use it

This commit is contained in:
pheralb
2025-08-27 19:29:55 +01:00
parent 879f8eb10e
commit 146e8fda04
3 changed files with 42 additions and 2 deletions
+4 -1
View File
@@ -1,3 +1,5 @@
import { optimizeSvg } from "@/utils/optimizeSvg";
interface SourceParams {
url: string | undefined;
}
@@ -5,5 +7,6 @@ interface SourceParams {
export const getSource = async (params: SourceParams) => {
const response = await fetch(params.url || "");
const content = await response.text();
return content;
const optimizedContent = optimizeSvg({ svgCode: content });
return optimizedContent;
};