import "./ZapGoal.css"; import { NostrEvent, NostrPrefix, createNostrLink } from "@snort/system"; import useZapsFeed from "Feed/ZapsFeed"; import { formatShort } from "Number"; import { findTag } from "SnortUtils"; import { CSSProperties } from "react"; import ZapButton from "./ZapButton"; export function ZapGoal({ ev }: { ev: NostrEvent }) { const zaps = useZapsFeed(createNostrLink(NostrPrefix.Note, ev.id)); const target = Number(findTag(ev, "amount")); const amount = zaps.reduce((acc, v) => (acc += v.amount * 1000), 0); const progress = 100 * (amount / target); return (