-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwallet_visualization.js
More file actions
97 lines (90 loc) · 3.71 KB
/
wallet_visualization.js
File metadata and controls
97 lines (90 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import React, { useState, useEffect } from 'react';
import { Wallet, ArrowDownCircle, ArrowUpCircle, Plus, DollarSign } from 'lucide-react';
const WalletDashboard = () => {
// This would be connected to actual wallet data in production
const [walletInfo, setWalletInfo] = useState({
address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
balance: 0.025,
currency: "ETH",
network: "Base"
});
const [transactions, setTransactions] = useState([
{
hash: "0x8a7d...f932",
type: "deposit",
amount: 0.01,
date: "2025-04-25",
status: "confirmed"
},
{
hash: "0x3c9a...e721",
type: "payment",
amount: 0.01,
date: "2025-04-25",
status: "confirmed"
}
]);
return (
<div className="p-4 bg-white dark:bg-gray-800 rounded-lg shadow-md">
<div className="flex items-center mb-4">
<Wallet className="w-6 h-6 mr-2 text-blue-600" />
<h2 className="text-xl font-bold text-gray-800 dark:text-gray-200">Base Wallet</h2>
</div>
<div className="mb-6 bg-gray-100 dark:bg-gray-700 p-3 rounded-md">
<div className="text-sm text-gray-500 dark:text-gray-400">Wallet Address</div>
<div className="flex items-center space-x-2">
<div className="font-mono text-sm truncate">
{walletInfo.address}
</div>
<button className="text-blue-600 hover:text-blue-800 text-xs">
Copy
</button>
</div>
</div>
<div className="flex mb-6">
<div className="flex-1 text-center p-3 bg-blue-50 dark:bg-blue-900 rounded-l-lg">
<div className="text-sm text-gray-500 dark:text-gray-400">Balance</div>
<div className="text-2xl font-bold text-blue-600 dark:text-blue-400">
{walletInfo.balance} {walletInfo.currency}
</div>
<div className="text-xs mt-1">on {walletInfo.network}</div>
</div>
<div className="flex-1 flex flex-col justify-around p-3 bg-gray-50 dark:bg-gray-700 rounded-r-lg space-y-2">
<button className="flex items-center justify-center text-sm bg-green-500 text-white p-1 rounded hover:bg-green-600">
<Plus size={16} className="mr-1" /> Add Funds
</button>
<button className="flex items-center justify-center text-sm bg-blue-500 text-white p-1 rounded hover:bg-blue-600">
<DollarSign size={16} className="mr-1" /> Pay
</button>
</div>
</div>
<div>
<h3 className="text-md font-semibold mb-2 text-gray-700 dark:text-gray-300">Recent Transactions</h3>
<div className="space-y-2">
{transactions.map((tx, index) => (
<div key={index} className="p-2 border border-gray-200 dark:border-gray-700 rounded flex items-center">
{tx.type === "deposit" ? (
<ArrowDownCircle size={16} className="text-green-500 mr-2" />
) : (
<ArrowUpCircle size={16} className="text-blue-500 mr-2" />
)}
<div className="flex-1">
<div className="flex justify-between">
<span className="text-sm font-medium">{tx.type === "deposit" ? "Received" : "Payment"}</span>
<span className="text-sm font-bold">
{tx.type === "deposit" ? "+" : "-"}{tx.amount} {walletInfo.currency}
</span>
</div>
<div className="flex justify-between text-xs text-gray-500">
<span>{tx.date}</span>
<span>{tx.status}</span>
</div>
</div>
</div>
))}
</div>
</div>
</div>
);
};
export default WalletDashboard;