forked from Kieran/zap.stream
fix: top zappers
This commit is contained in:
parent
aa66e678d1
commit
8bc4c1e2ce
@ -42,13 +42,12 @@ function totalZapped(pubkey: string, zaps: ParsedZap[]) {
|
||||
function TopZappers({ zaps }: { zaps: ParsedZap[] }) {
|
||||
const zappers = zaps
|
||||
.map((z) => (z.anonZap ? "anon" : z.sender))
|
||||
.map((p) => p as string)
|
||||
.slice(0, 3);
|
||||
.map((p) => p as string);
|
||||
|
||||
const sortedZappers = useMemo(() => {
|
||||
const sorted = [...new Set([...zappers])];
|
||||
sorted.sort((a, b) => totalZapped(b, zaps) - totalZapped(a, zaps));
|
||||
return sorted;
|
||||
return sorted.slice(0, 3);
|
||||
}, [zaps, zappers]);
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user