{#each payments as p, i} {@const amount = fund ? -p.amount : p.amount}
goto(`/payment/${p.id}`)} >
{s(Math.abs(amount), locale)}
{f(Math.abs(amount) * (p.rate / sats), p.currency, locale)} {#if p.tip}
+{Math.round((p.tip / Math.abs(amount)) * 100)}%
{/if}
{#if p.type === types.fund} {#if fund}
{p.user.username}
{:else}
{$t("payments.fund")}
{/if} {:else if p.with}
{p.with.username}
{:else}
{#if p.type === types.lightning || p.type === types.bolt12}
{:else if p.type === types.ecash}
{:else if p.type === types.reconcile}
{:else if p.type === types.bitcoin}
{:else if p.type === types.liquid}
{/if}
{#if p.type === types.ecash} {amount > 0 ? $t("payments.redeemed") : $t("payments.minted")} {:else} {amount > 0 ? p.confirmed ? $t("payments.received") : $t("payments.pending") : $t("payments.sent")} {/if}
{/if}
{format(new Date(p.created), "h:mm aaa", { locale: locales[language], })}
{format(new Date(p.created), "MMM d, yy", { locale: locales[language], })}
{:else}
{$t("payments.empty")}
{/each}