mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
20 lines
456 B
TypeScript
20 lines
456 B
TypeScript
import type { Mastodon } from "megalodon";
|
|
import type { Account } from "~/types/mastodon/account";
|
|
|
|
export const useAccountSearch = (
|
|
client: MaybeRef<Mastodon | null>,
|
|
q: string,
|
|
): Ref<Account[] | null> => {
|
|
const output = ref(null as Account[] | null);
|
|
|
|
ref(client)
|
|
.value?.searchAccount(q, {
|
|
resolve: true,
|
|
})
|
|
.then((res) => {
|
|
output.value = res.data;
|
|
});
|
|
|
|
return output;
|
|
};
|