feat: list accounts in space overview
This commit is contained in:
parent
071f6c5855
commit
11ac016e44
6 changed files with 155 additions and 44 deletions
32
internal/ui/blocks/account_card.templ
Normal file
32
internal/ui/blocks/account_card.templ
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package blocks
|
||||
|
||||
import "github.com/shopspring/decimal"
|
||||
import "strings"
|
||||
import "git.juancwu.dev/juancwu/budgit/internal/ui/components/icon"
|
||||
|
||||
type AccountCardInfo struct {
|
||||
ID string
|
||||
Name string
|
||||
Balance decimal.Decimal
|
||||
}
|
||||
|
||||
templ AccountCard(info AccountCardInfo) {
|
||||
<div class="px-2 py-2 block rounded-md hover:bg-sidebar-accent">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex gap-4 items-center">
|
||||
<div class="w-10 h-10 shrink-0 overflow-hidden rounded-md bg-muted flex items-center justify-center">
|
||||
{ strings.ToUpper(string(info.Name[0])) }
|
||||
</div>
|
||||
<div>
|
||||
<p class="font-semibold">{ info.Name }</p>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
${ info.Balance.StringFixedBank(2) }
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-full flex items-center justify-center">
|
||||
@icon.ChevronRight()
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue