import { Button } from '@/components/ui/button' import { getBitcoinConnectWalletDetails } from '@/lib/wallet-connection-details' import { useZap } from '@/providers/ZapProvider' import { Copy } from 'lucide-react' import { useTranslation } from 'react-i18next' import { toast } from 'sonner' export default function WalletConnectionDetails() { const { t } = useTranslation() const { isWalletConnected, walletLightningAddress } = useZap() if (!isWalletConnected) return null const details = getBitcoinConnectWalletDetails() if (!details) return null const connectedWalletAddress = walletLightningAddress ?? details.nwcLud16FromUrl ?? null const copyRelay = () => { if (!details.nwcRelayUrl) return navigator.clipboard.writeText(details.nwcRelayUrl) toast.success(t('Copied to clipboard')) } const copyAddress = () => { if (!connectedWalletAddress) return navigator.clipboard.writeText(connectedWalletAddress) toast.success(t('Copied to clipboard')) } return (
{t('Wallet connector')}
{details.connectorName} ({details.connectorType})
{t('Connected wallet address')}
{connectedWalletAddress ? ({connectedWalletAddress}
{t('This wallet did not report a Lightning address.')}
)}{t('NWC relay')}
{details.nwcRelayUrl ? ({details.nwcRelayUrl}
{t('Not an NWC connection (no relay URL in config).')}
)}