mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
20 lines
473 B
TypeScript
20 lines
473 B
TypeScript
import type { LysandClient } from "@lysand-org/client";
|
|
import type { Account } from "@lysand-org/client/types";
|
|
|
|
export const useAccountSearch = (
|
|
client: MaybeRef<LysandClient | 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;
|
|
};
|