summaryrefslogtreecommitdiff
path: root/web/src/components/icons/index.ts
diff options
context:
space:
mode:
authorJosh Kingsley <josh@joshkingsley.me>2025-11-01 15:52:38 +0200
committerJosh Kingsley <josh@joshkingsley.me>2025-11-01 15:52:38 +0200
commitdad5b47f0bb480532043df8d488f5609f731b00d (patch)
tree074bc0ba37578fd4ea5bf64a66ba9c730353ee9b /web/src/components/icons/index.ts
parenta472b004fb6470277541d763799cf42ae5e996b4 (diff)
feat(web): add icons
Diffstat (limited to 'web/src/components/icons/index.ts')
-rw-r--r--web/src/components/icons/index.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/src/components/icons/index.ts b/web/src/components/icons/index.ts
new file mode 100644
index 0000000..5731026
--- /dev/null
+++ b/web/src/components/icons/index.ts
@@ -0,0 +1,19 @@
+import plus16 from "./svgs/plus16.svg?raw";
+import minus16 from "./svgs/minus16.svg?raw";
+
+function makeIconFactory(source: string) {
+ return (attrs?: object): SVGElement => {
+ const parser = new DOMParser();
+ const doc = parser.parseFromString(source, "image/svg+xml");
+ const svg = doc.documentElement as unknown as SVGElement;
+
+ if (attrs) {
+ Object.entries(attrs).forEach(([k, v]) => svg.setAttribute(k, v));
+ }
+
+ return svg;
+ };
+}
+
+export const plus16Icon = makeIconFactory(plus16);
+export const minus16Icon = makeIconFactory(minus16);