import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { X, Coins, AlertTriangle, RefreshCw, Key } from 'lucide-react'; import { QRModal } from '@/components/ui/qr-modal'; import { nip19 } from 'nostr-tools'; import { useToast } from '@/hooks/useToast'; // Helper function to prevent complex template literals const getLightningAddress = (userPubkey?: string, npubCashUserInfo?: { name?: string } | null): string => { if (!userPubkey) return ''; const username = npubCashUserInfo?.name || nip19.npubEncode(userPubkey); return `${username}@npubx.cash`; }; interface ProofBreakdown { mintUrl: string; denominations: { [key: number]: number }; totalBalance: number; } interface MintToRemove { url: string; name?: string; } interface WalletModalProps { // Proof Breakdown Modal showProofBreakdown: boolean; setShowProofBreakdown: (show: boolean) => void; proofBreakdown: ProofBreakdown | null; // Remove Mint Modal showRemoveMintModal: boolean; setShowRemoveMintModal: (show: boolean) => void; mintToRemove: MintToRemove | null; onConfirmRemoveMint: () => void; isLoading: boolean; // QR Modals showLightningAddressQR: boolean; setShowLightningAddressQR: (show: boolean) => void; lightningAddressQRCode: string; userPubkey?: string; npubCashUserInfo?: { name?: string } | null; // Invoice Modal currentInvoice?: { amount: number; qrCodeUrl: string; invoice: string; expiry: number; } | null; showInvoiceModal: boolean; setShowInvoiceModal: (show: boolean) => void; mintQuoteUnsubscribeRef: React.MutableRefObject<(() => void) | null>; // Sent Token Modal sentToken: string | null; setSentToken: (token: string | null) => void; sentTokenQRCode: string; // Seed Phrase Info Modal showSeedPhraseInfo: boolean; setShowSeedPhraseInfo: (show: boolean) => void; } export function WalletModals({ showProofBreakdown, setShowProofBreakdown, proofBreakdown, showRemoveMintModal, setShowRemoveMintModal, mintToRemove, onConfirmRemoveMint, isLoading, showLightningAddressQR, setShowLightningAddressQR, lightningAddressQRCode, userPubkey, npubCashUserInfo, currentInvoice, showInvoiceModal, setShowInvoiceModal, mintQuoteUnsubscribeRef, sentToken, setSentToken, sentTokenQRCode, showSeedPhraseInfo, setShowSeedPhraseInfo, }: WalletModalProps) { const { toast } = useToast(); return ( <> {/* Proof Breakdown Modal */} {showProofBreakdown && proofBreakdown && (
Your seed phrase is a secure way to backup and restore your wallet
Your seed phrase is a 12-word recovery key that allows you to restore your wallet on any device. It's generated using industry-standard BIP39 wordlists.
Write down your seed phrase and store it securely offline. Anyone with access to your seed phrase can control your wallet and funds.
Note: The seed phrase shown above is masked for privacy. Click the copy button to access the actual phrase for backup purposes.