feat: clean up UI

This commit is contained in:
veganbeef
2025-06-13 14:13:59 -07:00
parent 21ccdf3623
commit 7263cdef0e
7 changed files with 308 additions and 131 deletions

View File

@@ -22,11 +22,21 @@ export async function GET(request: Request) {
try {
const neynar = new NeynarAPIClient({ apiKey });
const { users } = await neynar.fetchUserFollowers({
fid: parseInt(fid),
limit: 3,
viewerFid: parseInt(fid),
});
// TODO: update to use best friends endpoint once SDK merged in
const response = await fetch(
`https://api.neynar.com/v2/farcaster/user/best_friends?fid=${fid}&limit=3`,
{
headers: {
"x-api-key": apiKey,
},
}
);
if (!response.ok) {
throw new Error(`Neynar API error: ${response.statusText}`);
}
const { users } = await response.json() as { users: { user: { fid: number; username: string } }[] };
const bestFriends = users.map(user => ({
fid: user.user?.fid,