package account import ( "spend-sparrow/internal/core" "spend-sparrow/internal/template/svg" ) templ template(accounts []*Account) {
for _, account := range accounts { @accountItem(account) }
} templ editAccount(account *Account) { {{ var ( name string id string cancelUrl string ) if account == nil { name = "" id = "new" cancelUrl = "/empty" } else { name = account.Name id = account.Id.String() cancelUrl = "/account/" + id } }}
} templ accountItem(account *Account) {

{ account.Name }

if account.CurrentBalance < 0 {

{ core.FormatEuros(account.CurrentBalance) }

} else {

{ core.FormatEuros(account.CurrentBalance) }

} @svg.Eye() View
}