diff --git a/src/lib/components/ui/TagInput.svelte b/src/lib/components/ui/TagInput.svelte new file mode 100644 index 0000000..02e7e77 --- /dev/null +++ b/src/lib/components/ui/TagInput.svelte @@ -0,0 +1,99 @@ + + +
+
+ {#each tags as tag} + + {tag} + + + {/each} + +
+ + {#if suggestions.length > 0} +
+ {#each suggestions.slice(0, 8) as tag} + + {/each} +
+ {/if} + + {#if existingTags.length > 0 && input.length === 0} +
+ {#each existingTags.filter(t => !tags.includes(t.name)) as tag} + + {/each} +
+ {/if} + + +
diff --git a/src/routes/(app)/wiki/[slug]/edit/+page.svelte b/src/routes/(app)/wiki/[slug]/edit/+page.svelte index 5a24c7f..51cefbd 100644 --- a/src/routes/(app)/wiki/[slug]/edit/+page.svelte +++ b/src/routes/(app)/wiki/[slug]/edit/+page.svelte @@ -1,6 +1,7 @@