diff --git a/src/element/provider/nostr/history.tsx b/src/element/provider/nostr/history.tsx index ac10406..2a3fa7a 100644 --- a/src/element/provider/nostr/history.tsx +++ b/src/element/provider/nostr/history.tsx @@ -1,6 +1,9 @@ import { BalanceHistoryResult, NostrStreamProvider } from "@/providers/zsz"; +import { eventLink } from "@/utils"; +import { NostrEvent } from "@snort/system"; import { useEffect, useState } from "react"; -import { FormattedMessage } from "react-intl"; +import { FormattedMessage, FormattedNumber } from "react-intl"; +import { Link } from "react-router-dom"; export default function BalanceHistory({ provider }: { provider?: NostrStreamProvider }) { const [page] = useState(0); @@ -22,16 +25,30 @@ export default function BalanceHistory({ provider }: { provider?: NostrStreamPro
- {rows?.items.map(a => ( - <> -
{new Date(a.created * 1000).toLocaleString()}
-
{a.desc}
-
- {a.type === 0 ? "+" : "-"} - {a.amount} -
- - ))} + {rows?.items.map(a => { + let ev: NostrEvent | undefined; + if (a.desc && a.desc.startsWith("{")) { + ev = JSON.parse(a.desc) as NostrEvent; + } + return ( + <> +
{new Date(a.created * 1000).toLocaleString()}
+
+ {ev ? ( + + + + ) : ( + a.desc + )} +
+
+ {a.type === 0 ? "+" : "-"} + +
+ + ); + })} ); } diff --git a/src/lang.json b/src/lang.json index 4752866..899e72d 100644 --- a/src/lang.json +++ b/src/lang.json @@ -140,6 +140,9 @@ "69hmpj": { "defaultMessage": "Raid from {name}" }, + "6PK5Jy": { + "defaultMessage": "Past Stream" + }, "6Z2pvJ": { "defaultMessage": "Stream Providers" }, diff --git a/src/translations/en.json b/src/translations/en.json index 0950cb5..85c49ab 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -46,6 +46,7 @@ "5tM0VD": "Stream Started", "5vMmmR": "Usernames are not unique on Nostr. The nostr address is your unique human-readable address that is unique to you upon registration.", "69hmpj": "Raid from {name}", + "6PK5Jy": "Past Stream", "6Z2pvJ": "Stream Providers", "6pr6hJ": "Minimum amount for text to speech", "7+bCC1": "Stream url must start with rtmp://",