Skip to content

Commit 0db66ad

Browse files
committed
[Dashboard] replace chakra stats in accounts
1 parent 2fc083f commit 0db66ad

File tree

1 file changed

+8
-16
lines changed
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components

1 file changed

+8
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
"use client";
22

3-
import {
4-
SimpleGrid,
5-
Skeleton,
6-
Stat,
7-
StatLabel,
8-
StatNumber,
9-
} from "@chakra-ui/react";
103
import type { ThirdwebContract } from "thirdweb";
114
import { totalAccounts } from "thirdweb/extensions/erc4337";
125
import { useReadContract } from "thirdweb/react";
13-
import { Card } from "tw-components";
6+
import { StatCard } from "../../overview/components/stat-card";
147

158
type AccountsCountProps = {
169
contract: ThirdwebContract;
@@ -19,13 +12,12 @@ type AccountsCountProps = {
1912
export const AccountsCount: React.FC<AccountsCountProps> = ({ contract }) => {
2013
const totalAccountsQuery = useReadContract(totalAccounts, { contract });
2114
return (
22-
<SimpleGrid columns={{ base: 1, md: 3 }} spacing={{ base: 3, md: 6 }}>
23-
<Card as={Stat}>
24-
<StatLabel mb={{ base: 1, md: 0 }}>Total Accounts</StatLabel>
25-
<Skeleton isLoaded={totalAccountsQuery.isSuccess}>
26-
<StatNumber>{totalAccountsQuery.data?.toString()}</StatNumber>
27-
</Skeleton>
28-
</Card>
29-
</SimpleGrid>
15+
<div className="grid grid-cols-1 gap-3 md:grid-cols-3 md:gap-6">
16+
<StatCard
17+
label="Total Accounts"
18+
value={totalAccountsQuery.data?.toString() || "0"}
19+
isPending={totalAccountsQuery.isPending}
20+
/>
21+
</div>
3022
);
3123
};

0 commit comments

Comments
 (0)