@noya-app/noya-api-client-react 0.1.46 → 0.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2457,6 +2457,24 @@ function useNoyaWorkspaces() {
2457
2457
  }, [client, fetchWorkspaces]);
2458
2458
  return workspaces;
2459
2459
  }
2460
+ function useNoyaWorkspaceMembers(workspaceId) {
2461
+ const { workspaces, loading } = useNoyaWorkspaces();
2462
+ return useMemo2(() => {
2463
+ const workspace = workspaces.find((w) => w.id === workspaceId);
2464
+ const members = workspace?.members.map((m) => ({
2465
+ userId: m.userId,
2466
+ name: m.user.name,
2467
+ email: m.user.email,
2468
+ image: m.user.image,
2469
+ role: m.role
2470
+ })) ?? [];
2471
+ const membersById = /* @__PURE__ */ new Map();
2472
+ for (const member of members) {
2473
+ membersById.set(member.userId, member);
2474
+ }
2475
+ return { members, membersById, loading };
2476
+ }, [workspaces, workspaceId, loading]);
2477
+ }
2460
2478
  function useNoyaMultiplayerRoomToken(fileId) {
2461
2479
  const client = useNoyaClientOrFallback();
2462
2480
  const multiplayerRoomToken = useObservable(
@@ -15275,6 +15293,7 @@ export {
15275
15293
  useNoyaUserData,
15276
15294
  useNoyaWorkspaceBilling,
15277
15295
  useNoyaWorkspaceInvitations,
15296
+ useNoyaWorkspaceMembers,
15278
15297
  useNoyaWorkspaces,
15279
15298
  useOptionalNoyaClient,
15280
15299
  useOptionalNoyaCreators,