]> Untitled Git - lemmy-ui.git/blob - src/shared/utils/app/person-search.ts
fix: Fix badge alignment and break out into component
[lemmy-ui.git] / src / shared / utils / app / person-search.ts
1 import { fetchUsers } from "@utils/app";
2 import { hostname } from "@utils/helpers";
3 import { PersonTribute } from "@utils/types";
4
5 export default async function personSearch(
6   text: string
7 ): Promise<PersonTribute[]> {
8   const usersResponse = await fetchUsers(text);
9
10   return usersResponse.map(pv => ({
11     key: `@${pv.person.name}@${hostname(pv.person.actor_id)}`,
12     view: pv,
13   }));
14 }