feat: use RelayLink component in wallet info dropdown

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.
This commit is contained in:
Claude
2026-01-18 19:27:22 +00:00
parent 3408872811
commit 0b9d4422e2

View File

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