{#snippet card(className: string, icon: string, message: string, actions: Snippet)}

{message}

{@render actions()}
{/snippet} {#snippet churnedActions()} {#if openInvoice} {/if} {/snippet} {#snippet payInvoiceActions()} {/snippet} {#snippet updateMethodActions()} {/snippet} {#snippet autopayActions()} {/snippet} {#if tenant} {#if tenant.churned_at} {@render card( "card-secondary", DangerTriangle, "Your account is past due and some relays are paused. Pay your balance or update your payment method to restore service.", churnedActions, )} {:else if openInvoice && !suppressInline} {@render card( "card-secondary", DangerCircle, "You have an unpaid invoice. Pay it now to keep your relays running.", payInvoiceActions, )} {:else if tenant.nwc_is_set && tenant.nwc_error} {@render card( "card-secondary", DangerCircle, "Your Lightning wallet couldn't be charged. Update your payment method.", updateMethodActions, )} {:else if tenant.stripe_payment_method_id && tenant.stripe_error} {@render card( "card-secondary", DangerCircle, "Your card couldn't be charged. Update your payment method.", updateMethodActions, )} {:else if hasPaidSubscription && !autopayConfigured(tenant) && !suppressInline && !dismissedAutopay} {@render card( "card-primary", InfoCircle, "Set up automatic payments so your subscription renews without interruption.", autopayActions, )} {/if} {/if}