feat: use RelayLink component in wallet info dropdown (#139)

Replace plain text relay URL with RelayLink component in WalletViewer's
info dropdown. This provides:
- Clickable relay URLs that open relay detail window
- Relay icon display (if available)
- Insecure relay warnings (ws://)
- Consistent styling with other relay displays

Also removes unused ExternalLink import.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Alejandro
2026-01-18 20:28:46 +01:00
committed by GitHub
parent 3408872811
commit 3172288ecf

View File

@@ -19,7 +19,6 @@ import {
ArrowDownLeft,
LogOut,
ChevronDown,
ExternalLink,
} from "lucide-react";
import { Virtuoso } from "react-virtuoso";
import { useWallet } from "@/hooks/useWallet";
@@ -49,6 +48,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import ConnectWalletDialog from "./ConnectWalletDialog";
import { RelayLink } from "@/components/nostr/RelayLink";
interface Transaction {
type: "incoming" | "outgoing";
@@ -825,21 +825,17 @@ export default function WalletViewer() {
)}
{state.nwcConnection?.relays &&
state.nwcConnection.relays.length > 0 && (
<div className="flex justify-between text-xs">
<span className="text-muted-foreground">Relay</span>
<a
href={state.nwcConnection.relays[0]}
target="_blank"
rel="noopener noreferrer"
className="font-mono text-primary hover:underline flex items-center gap-1"
>
<span className="truncate max-w-[180px]">
{state.nwcConnection.relays[0]
.replace("wss://", "")
.replace("ws://", "")}
</span>
<ExternalLink className="size-3 flex-shrink-0" />
</a>
<div className="space-y-1">
<span className="text-xs text-muted-foreground">
Relay
</span>
<RelayLink
url={state.nwcConnection.relays[0]}
className="py-0"
urlClassname="text-xs"
iconClassname="size-3"
showInboxOutbox={false}
/>
</div>
)}
</div>