Files
arthome/app/composables/icons.ts
2024-08-30 18:15:07 +02:00

19 lines
336 B
TypeScript

export function useIcons() {
const loading = ref(false)
async function search(query: string) {
if (query) {
loading.value = true
}
const response = await $fetch('/api/icons/search', {
query: { query },
})
loading.value = false
return response.icons
}
return {
loading,
search,
}
}