Use NostrLink everywhere

This commit is contained in:
2023-09-19 09:30:01 +01:00
parent a1cd56292a
commit 9fb6f0dfee
24 changed files with 164 additions and 220 deletions

View File

@ -1,5 +1,5 @@
import "./LiveStreams.css";
import { NostrEvent, NostrPrefix, encodeTLV } from "@snort/system";
import { NostrEvent, NostrLink } from "@snort/system";
import { findTag } from "SnortUtils";
import { CSSProperties, useMemo } from "react";
import { Link } from "react-router-dom";
@ -32,7 +32,7 @@ function LiveStreamEvent({ ev }: { ev: NostrEvent }) {
const image = findTag(ev, "image");
const status = findTag(ev, "status");
const link = encodeTLV(NostrPrefix.Address, findTag(ev, "d") ?? "", undefined, ev.kind, ev.pubkey);
const link = NostrLink.fromEvent(ev).encode();
const imageProxy = proxy(image ?? "");
return (