This commit is contained in:
2024-08-30 18:15:07 +02:00
parent 8cadaf08a0
commit c77503ed45
17 changed files with 273 additions and 149 deletions

View File

@@ -33,6 +33,8 @@ async function handleCreate(event: FormSubmitEvent<CreateTabSchemaType>) {
state.primary = false
state.categoryId = props.category?.id
}
const { loading, search } = useIcons()
</script>
<template>
@@ -59,7 +61,31 @@ async function handleCreate(event: FormSubmitEvent<CreateTabSchemaType>) {
</UFormGroup>
<UFormGroup label="Icon " name="icon">
<UInput v-model="state.icon" type="text" />
<USelectMenu
v-model="state.icon"
:loading="loading"
:searchable="search"
placeholder="Select an icon"
searchable-placeholder="Search an icon"
>
<template #label>
<div v-if="state.icon" class="flex items-center gap-2">
<UIcon size="20" :name="`i-${state.icon}`" />
<span class="truncate">{{ state.icon }}</span>
</div>
</template>
<template #option="{ option }">
<div class="flex items-center gap-2">
<UIcon size="20" :name="`i-${option}`" />
<span class="truncate">{{ option }}</span>
</div>
</template>
<template #empty>
Enter an icon name, keyword or tag
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup label="Color " name="color">