import type { Overview } from "../lib/overview";
import { yen } from "../lib/format";
import { host } from "../lib/agent";
import { Button, ComingWithV2, Kpi, ScreenHead } from "../components/ui";
export function Wallet({ ov }: { ov: Overview | null }) {
return (
<>
<ScreenHead title="Wallet" sub="Fake credits, shown in ¥ units (ADR 0027)">
<Button disabled={!ov} onClick={() => ov && host.openExternal(ov.hub.url)}>
Open the hub ↗
</Button>
</ScreenHead>
<div className="grid grid-cols-3 gap-2.5">
<Kpi label="Balance" value={yen(ov?.account?.balance)} sub={ov?.account?.email} />
<Kpi label="Earned today" value={yen(ov?.earnings?.today)} />
<Kpi label="Earned 7 d" value={yen(ov?.earnings?.last7d)} />
</div>
<ComingWithV2 what="Earned and spent per day, per product and per node." route="GET /v2/ledger" />
</>
);
}