From 8751ba26ebf7b7761b9e237f2bf3453623dd1018 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Mon, 6 Oct 2025 10:13:39 +0700
Subject: added frontend WS connection for demonstration purposes

---
 gui/src/components/post/wrappers/NostrIcon.tsx | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 gui/src/components/post/wrappers/NostrIcon.tsx

(limited to 'gui/src/components/post/wrappers/NostrIcon.tsx')

diff --git a/gui/src/components/post/wrappers/NostrIcon.tsx b/gui/src/components/post/wrappers/NostrIcon.tsx
new file mode 100644
index 0000000..30fbfe9
--- /dev/null
+++ b/gui/src/components/post/wrappers/NostrIcon.tsx
@@ -0,0 +1,25 @@
+import Icon from "@/components/Icon";
+import useLocalState from "@/state/state";
+import toast from "react-hot-toast";
+import type { Poast } from "@/types/trill";
+export default function ({ poast }: { poast: Poast }) {
+  const { relays, api } = useLocalState((s) => ({
+    relays: s.relays,
+    api: s.api,
+  }));
+
+  async function sendToRelay(e: React.MouseEvent) {
+    e.stopPropagation();
+    //
+    const urls = Object.keys(relays);
+    await api!.relayPost(poast.host, poast.id, urls);
+    toast.success("Post relayed");
+  }
+  // TODO round up all helpers
+
+  return (
+    <div className="icon" role="link" onMouseUp={sendToRelay}>
+      <Icon name="nostr" size={20} title="relay to nostr" />
+    </div>
+  );
+}
-- 
cgit v1.2.3

