@@ -81,6 +152,25 @@ export function ClaimableBalanceCard() {
const [loading, setLoading] = useState(false);
const [error, setError] = useState
(null);
+ const load = useCallback(() => {
+ if (!address) return;
+
+ setLoading(true);
+ setError(null);
+ getClient()
+ .account.getClaimableBalances(address)
+ .then(({ data, error: err }) => {
+ if (err) {
+ setError(err);
+ return;
+ }
+ setBalances(data ?? []);
+ })
+ .finally(() => {
+ setLoading(false);
+ });
+ }, [address]);
+
useEffect(() => {
if (!address) return;
@@ -141,13 +231,21 @@ export function ClaimableBalanceCard() {
) : error ? (
{error}
) : balances.length === 0 ? (
-
- No claimable balances
-
+
+
+
+ No claimable balances
+
+
) : (
{balances.map((cb) => (
-
+
))}
)}