add trending stuff to right column
This commit is contained in:
@ -6,14 +6,14 @@ import PageSpinner from "@/Element/PageSpinner";
|
||||
import NostrBandApi from "@/External/NostrBand";
|
||||
import { ErrorOrOffline } from "./ErrorOrOffline";
|
||||
|
||||
export default function TrendingUsers({ title }: { title?: ReactNode }) {
|
||||
export default function TrendingUsers({ title, count = 5 }: { title?: ReactNode; count?: number }) {
|
||||
const [userList, setUserList] = useState<HexKey[]>();
|
||||
const [error, setError] = useState<Error>();
|
||||
|
||||
async function loadTrendingUsers() {
|
||||
const api = new NostrBandApi();
|
||||
const users = await api.trendingProfiles();
|
||||
const keys = users.profiles.map(a => a.pubkey);
|
||||
const keys = users.profiles.map(a => a.pubkey).slice(0, count); // Limit the user list to the count
|
||||
setUserList(keys);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user