about summary refs log tree commit diff
path: root/src/state/queries/profile.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/profile.ts')
-rw-r--r--src/state/queries/profile.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/state/queries/profile.ts b/src/state/queries/profile.ts
new file mode 100644
index 000000000..c2cd19482
--- /dev/null
+++ b/src/state/queries/profile.ts
@@ -0,0 +1,13 @@
+import {useQuery} from '@tanstack/react-query'
+
+import {PUBLIC_BSKY_AGENT} from '#/state/queries'
+
+export function useProfileQuery({did}: {did: string}) {
+  return useQuery({
+    queryKey: ['getProfile', did],
+    queryFn: async () => {
+      const res = await PUBLIC_BSKY_AGENT.getProfile({actor: did})
+      return res.data
+    },
+  })
+}