import { useEffect, useState } from "react"; import { useUIStore } from "../../stores/ui"; import { useUserStore } from "../../stores/user"; import { useNotificationsStore } from "../../stores/notifications"; import { useProfile } from "../../hooks/useProfile"; import { useNip05Verified } from "../../hooks/useNip05Verified"; import { fetchFollowers, ensureConnected } from "../../lib/nostr"; import { shortenPubkey } from "../../lib/utils"; function FollowRow({ pubkey, followsYou, }: { pubkey: string; followsYou?: boolean; }) { const profile = useProfile(pubkey); const name = profile?.displayName || profile?.name || shortenPubkey(pubkey); const avatar = profile?.picture; const nip05 = profile?.nip05; const verified = useNip05Verified(pubkey, nip05); const { follows, follow, unfollow, pubkey: ownPubkey } = useUserStore(); const { openProfile } = useUIStore(); const isFollowing = follows.includes(pubkey); const isSelf = pubkey === ownPubkey; return (
{followersError}
)} {!followersLoading && !followersError && followers.length === 0 && followersFetched && (No followers found yet.
)} {followers.map((pk) => (Not following anyone yet.
)} {follows.map((pk) => (