"use client"; import { cn, formatCount, getTwoLetters } from "@/lib/utils"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import useProfile from "@/lib/hooks/useProfile"; import { nip19 } from "nostr-tools"; type AvatarStackProps = { pubkeys: string[]; remaining?: number; className?: string; }; const zIndexes = ["z-50", "z-40", "z-30", "z-20", "z-10", "z-0"]; export default function AvatarStack({ pubkeys, className, remaining, }: AvatarStackProps) { return (
{pubkeys.map((p, idx) => { if (p) { return ( ); } })} {!!remaining && ( {`+${formatCount( remaining, )}`} )}
); } function User({ pubkey, className }: { pubkey: string; className: string }) { const { profile } = useProfile(pubkey); const npub = nip19.npubEncode(pubkey); return ( {getTwoLetters({ npub, profile })} ); }