{#snippet button( action: Action, key: string, primary = false )} {action.label} {key} {/snippet}
{#if named}

{a.name}

{/if} {#if side === "settled"}

Settled

{:else}

{side === "owed" ? "Owes you" : "You owe"} {format(amount)}

{/if} {#if overpaid(a)}

{credit ? "Paid you back" : "You paid back"} {format(amount)} more than borrowed

{/if}
{#if last}
Last movement
{formatDate(last.date)}, {ago(last.date)}
{#if average === null}
No repayments yet
{:else}
{credit ? "Usually pays back in" : "You usually pay back in"}
{average} {average === 1 ? "day" : "days"}
{/if} {#if received > 0}
Received in 12 months
{format(received)}
{/if} {#if sent > 0}
Sent in 12 months
{format(sent)}
{/if}
{/if} {#if received + sent > 0} {/if} {#if rows > 0} {#each shown as m, i (`${m.group}-${i}`)} {:else} {/each}
{formatDate(m.date, "short")} {m.opening ? "Opening balance" : m.description}
{list ? "No movements yet" : ""}
{/if}
{#if actions} {/if}