Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
686 B
TypeScript
26 lines
686 B
TypeScript
import { PrivateUser, User } from 'common/user'
|
|
import { useEffect, useState } from 'react'
|
|
import { getRecentlyActiveUsers } from 'web/lib/supabase/users'
|
|
|
|
export const useRecentlyActiveUsersAndPrivateUsers = (limit: number) => {
|
|
const [usersAndPrivates, setUsersAndPrivates] = useState<
|
|
{
|
|
user: User
|
|
privateUser: PrivateUser | undefined
|
|
}[]
|
|
>()
|
|
const loadUsers = async () => {
|
|
const users = await getRecentlyActiveUsers(limit)
|
|
const usersAndPrivates = users.map((user) => ({
|
|
user,
|
|
privateUser: undefined,
|
|
}))
|
|
setUsersAndPrivates(usersAndPrivates)
|
|
}
|
|
useEffect(() => {
|
|
loadUsers()
|
|
}, [limit])
|
|
|
|
return usersAndPrivates
|
|
}
|