diff --git a/src/routes/console/account/payments/billingAddress.svelte b/src/routes/console/account/payments/billingAddress.svelte index 40d8b8788..a8c5eab98 100644 --- a/src/routes/console/account/payments/billingAddress.svelte +++ b/src/routes/console/account/payments/billingAddress.svelte @@ -17,6 +17,10 @@ import DeleteAddress from './deleteAddress.svelte'; import EditAddressModal from './editAddressModal.svelte'; import type { Address } from '$lib/sdk/billing'; + import { organizationList, type Organization } from '$lib/stores/organization'; + import { tooltip } from '$lib/actions/tooltip'; + import { base } from '$app/paths'; + import { Pill } from '$lib/elements'; let show = false; let showEdit = false; @@ -28,6 +32,8 @@ onMount(async () => { countryList = await sdk.forProject.locale.listCountries(); }); + + $: orgList = $organizationList.teams as unknown as Organization[]; @@ -42,6 +48,7 @@ Billing address + @@ -49,6 +56,10 @@ {@const country = countryList?.countries?.find( (c) => c.code === address.country )} + {@const linkedOrgs = orgList?.filter( + (org) => address.$id === org.billingAddressId + )} +
@@ -62,6 +73,30 @@

{country ? country.name : address.country}

+ + {#if linkedOrgs?.length > 0} +
+

This billing address is linked to the following organizations:

+ ${linkedOrgs + .map( + (org) => + `${org.name}` + ) + .join('')} +
` + }}> + + linked to organization + + + {/if} +