void,
+ id?: string,
+}> = (props) => {
+
+ const threadContext = useThreadContext();
+
+ const [hasMoreZaps, setHasMoreZaps] = createSignal(false);
+
+ const topZaps = () => {
+ const zaps = [...props.topZaps];
+
+ let limit = 0;
+ let digits = 0;
+
+ for (let i=0; i< zaps.length; i++) {
+ const amount = zaps[i].amount || 0;
+ const length = Math.log(amount) * Math.LOG10E + 1 | 0;
+
+ digits += length;
+
+ if (digits > 25 || limit > 7) break;
+
+ limit++;
+ }
+
+ const highlights = zaps.slice(0, limit);
+
+ setHasMoreZaps(() => highlights.length < props.zapCount - 1);
+
+ return highlights;
+ }
+
+ const zapSender = (zap: TopZap) => {
+ return threadContext?.users.find(u => u.pubkey === zap.pubkey);
+ };
+ return (
+
+
+
+
+
+ }
+ >
+