diff --git a/src/routes/settings/ManageFederations.tsx b/src/routes/settings/ManageFederations.tsx index ed932324..ead77b4c 100644 --- a/src/routes/settings/ManageFederations.tsx +++ b/src/routes/settings/ManageFederations.tsx @@ -6,9 +6,19 @@ import { SubmitHandler } from "@modular-forms/solid"; import { useSearchParams } from "@solidjs/router"; -import { createSignal, For, onMount, Show } from "solid-js"; +import { + createResource, + createSignal, + For, + Match, + onMount, + Show, + Suspense, + Switch +} from "solid-js"; import { + AmountSats, BackLink, Button, ConfirmDialog, @@ -130,7 +140,10 @@ function AddFederationForm() { ); } -function FederationListItem(props: { fed: MutinyFederationIdentity }) { +function FederationListItem(props: { + fed: MutinyFederationIdentity; + balance?: bigint; +}) { const i18n = useI18n(); const [state, actions] = useMegaStore(); @@ -165,6 +178,16 @@ function FederationListItem(props: { fed: MutinyFederationIdentity }) {

{props.fed.welcome_message}

+ + + + + { + try { + const balances = + await state.mutiny_wallet?.get_federation_balances(); + return balances?.balances || []; + } catch (e) { + console.error(e); + return []; + } + }); + return ( @@ -220,9 +254,33 @@ export function ManageFederations() { - - {(fed) => } - + + + + + {(fed) => ( + + b.identity_federation_id === + fed.federation_id + )?.balance + } + /> + )} + + + + + {(fed) => ( + + )} + + + +