-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPortfolioSummary.jsx
More file actions
29 lines (26 loc) · 1.03 KB
/
Copy pathPortfolioSummary.jsx
File metadata and controls
29 lines (26 loc) · 1.03 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
import Card from './Card.jsx';
import StatBlock from './StatBlock.jsx';
import { fmtNative, shortAddr } from '../data/launches.js';
import { RITUAL_TESTNET } from '../config/ritual.js';
const SYM = RITUAL_TESTNET.nativeCurrency.symbol;
const nat = (v) => (
<>
{fmtNative(v)} <span className="text-base text-faint">{SYM}</span>
</>
);
/** Wallet-level stat strip shown at the top of the Portfolio page. */
export default function PortfolioSummary({ nativeBalance, totalValueNative, holdingsCount, address }) {
return (
<Card className="p-6 sm:p-8">
<div className="grid grid-cols-2 gap-8 lg:grid-cols-4">
<StatBlock label="Holdings value" value={nat(totalValueNative)} accent />
<StatBlock label="Wallet balance" value={nat(nativeBalance)} />
<StatBlock label="Tokens held" value={holdingsCount.toLocaleString('en-US')} />
<StatBlock
label="Wallet"
value={<span className="mono !text-2xl">{address ? shortAddr(address) : '—'}</span>}
/>
</div>
</Card>
);
}