{#snippet spark(
values: number[]
)}
{#if values.length > 1}
{assets.isPending ? "" : "No accounts on the home screen."}
{/if}
{#each groups as group (group.code)}
{#if group.balance && group.change}
Account
Balance
This period
{TREND_DAYS}
days
{/if}
{#each group.accounts as account (account.id)}
{@const a = account.attributes}
{@const key = accountKey(account.id)}
{@const open = expanded.includes(account.id)}
{group.code}
{@render balance(group.balance)}
{#if toNumber(group.change.amount) !== 0}
column.point(key)}
>
{#if open}
{#each recentRows.get(account.id) ?? [] as tx (tx.key)}
{@render balance(moneyOf(a, a.current_balance))}
{#if toNumber(a.balance_difference) !== 0}
column.point(tx.key)}
>
{:else}
{formatDate(tx.date, "short")}
{tx.title}
{/each}
{/if}
{/each}
{/each}
{recent[expanded.indexOf(account.id)]?.isPending
? ""
: "Nothing in the last year."}