import { useEffect, useState } from 'react'; import { EyeOff, Plus, Trash2, RefreshCw, AlertCircle, ShieldAlert, Info, Wallet, } from 'lucide-react'; import { useDecoyStore, DecoyWallet } from '../../store/decoy'; function SetupDecoyModal({ onClose }: { onClose: () => void }) { const { setup, isLoading } = useDecoyStore(); const [password, setPassword] = useState(''); const [confirm, setConfirm] = useState(''); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (password !== confirm) { setError('Passwords do not match'); return; } if (password.length < 8) { setError('Password must be at least 8 characters'); return; } try { await setup(password); onClose(); } catch (err) { setError(err instanceof Error ? err.message : 'Setup failed'); } }; return (

Setup Decoy Wallets

Create a "duress password" that opens decoy wallets instead of your real wallet. This provides plausible deniability if forced to unlock your wallet.

setPassword(e.target.value)} className="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-white" />
setConfirm(e.target.value)} className="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-white" />
{error &&

{error}

}
); } function CreateDecoyModal({ onClose }: { onClose: () => void }) { const { createDecoy, isLoading } = useDecoyStore(); const [name, setName] = useState(''); const [balance, setBalance] = useState('0.1'); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); try { await createDecoy(name, parseFloat(balance)); onClose(); } catch (err) { setError(err instanceof Error ? err.message : 'Failed to create'); } }; return (

Create Decoy Wallet

setName(e.target.value)} placeholder="e.g., Savings" className="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-white" />
setBalance(e.target.value)} className="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-white" />
{error &&

{error}

}
); } function DecoyCard({ decoy }: { decoy: DecoyWallet }) { const { deleteDecoy } = useDecoyStore(); const [showConfirm, setShowConfirm] = useState(false); return (

{decoy.name}

{decoy.address.slice(0, 20)}...

{!showConfirm ? ( ) : (
)}

{decoy.balanceHuman}

); } export default function DecoyDashboard() { const { isEnabled, decoys, isLoading, error, checkEnabled, fetchDecoys } = useDecoyStore(); const [showSetup, setShowSetup] = useState(false); const [showCreate, setShowCreate] = useState(false); useEffect(() => { checkEnabled(); fetchDecoys(); }, [checkEnabled, fetchDecoys]); return (

Decoy Wallets

Plausible deniability for your crypto

{isEnabled && ( )}
{error && (
{error}
)} {!isEnabled ? (

Decoy Wallets Not Enabled

Set up a duress password that opens fake wallets to protect your real funds under coercion.

) : ( <>

Decoy Protection Active

Using your duress password will show decoy wallets instead of real funds

{decoys.length === 0 ? (

No decoy wallets created yet

) : (
{decoys.map((d) => ( ))}
)} )}

How Decoy Wallets Work

When unlocking with your duress password, decoy wallets are shown instead of your real wallet. The decoys appear legitimate but contain minimal funds, protecting your actual holdings.

{showSetup && setShowSetup(false)} />} {showCreate && setShowCreate(false)} />}
); }