bye svelte; welcome solid

This commit is contained in:
Moritz Jung 2026-01-29 12:19:27 +01:00
parent 97cf350a32
commit 2fe6f6fc37
21 changed files with 686 additions and 569 deletions

24
src/settings/Icon.tsx Normal file
View file

@ -0,0 +1,24 @@
import { onMount, Show } from 'solid-js';
import { setIcon } from 'obsidian';
interface IconProps {
iconName?: string;
}
export default function Icon(props: IconProps) {
let iconEl: HTMLDivElement | undefined;
onMount(() => {
if (iconEl) {
setIcon(iconEl, props.iconName || '');
}
});
return (
<Show when={(props.iconName || '').length > 0}>
<div class="icon-wrapper">
<div ref={iconEl} class="icon"></div>
</div>
</Show>
);
}