mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
18 lines
417 B
TypeScript
18 lines
417 B
TypeScript
|
|
import type { Client } from "@versia/client";
|
||
|
|
import type { Account } from "@versia/client/types";
|
||
|
|
|
||
|
|
export const useAccountFromAcct = (
|
||
|
|
client: MaybeRef<Client | null>,
|
||
|
|
acct: string,
|
||
|
|
): Ref<Account | null> => {
|
||
|
|
const output = ref(null as Account | null);
|
||
|
|
|
||
|
|
ref(client)
|
||
|
|
.value?.lookupAccount(acct)
|
||
|
|
.then((res) => {
|
||
|
|
output.value = res.data;
|
||
|
|
});
|
||
|
|
|
||
|
|
return output;
|
||
|
|
};
|