Add settings management with package manager and SVG optimization options

This commit is contained in:
pheralb
2025-09-21 19:15:11 +01:00
parent 0c78255847
commit 3e507cf7c8
10 changed files with 227 additions and 44 deletions
+2
View File
@@ -2,11 +2,13 @@ import { optimizeSvg } from "@/utils/optimizeSvg";
interface SourceParams {
url: string | undefined;
optimize?: boolean;
}
export const getSource = async (params: SourceParams) => {
const response = await fetch(params.url || "");
const content = await response.text();
if (!params.optimize) return content;
const optimizedContent = optimizeSvg({ svgCode: content });
return optimizedContent;
};