From d709d5d5d8fe5363425733e28b03d78c4206266a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20G=C3=B3mez?= Date: Thu, 19 Mar 2026 12:31:02 +0100 Subject: [PATCH] feat: rich relay links in chat --- src/components/nostr/RichText/Relay.tsx | 32 +++++-------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/components/nostr/RichText/Relay.tsx b/src/components/nostr/RichText/Relay.tsx index 2a9eeae..e306e34 100644 --- a/src/components/nostr/RichText/Relay.tsx +++ b/src/components/nostr/RichText/Relay.tsx @@ -1,39 +1,19 @@ import type { RelayNode } from "@/lib/relay-transformer"; -import { useAddWindow } from "@/core/state"; +import { RelayLink } from "../RelayLink"; interface RelayNodeProps { node: RelayNode; } -/** - * Format relay URL for display by removing protocol and trailing slashes - */ -function formatRelayUrlForDisplay(url: string): string { - return url - .replace(/^wss?:\/\//, "") // Remove ws:// or wss:// - .replace(/\/$/, ""); // Remove trailing slash -} - /** * Renders a relay URL as a clickable link that opens the relay viewer */ export function Relay({ node }: RelayNodeProps) { - const addWindow = useAddWindow(); - const { url } = node; - - const displayUrl = formatRelayUrlForDisplay(url); - - const openRelay = () => { - addWindow("relay", { url }); - }; - return ( - + ); }