mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
19 lines
336 B
TypeScript
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,
|
|
}
|
|
}
|