magicwallet/pages/index.templ

42 lines
1.2 KiB
Plaintext

package pages
import (
"fmt"
"github.com/ekzyis/magicwallet/pages/components"
"github.com/ekzyis/magicwallet/db/models"
"github.com/ekzyis/magicwallet/nostr/nwc"
)
templ Index() {
{{ u := ctx.Value("user").(models.User)}}
{{ w := ctx.Value("wallet").(models.Wallet) }}
{{ nwc := ctx.Value("nwc").(*nwc.NwcConnection).Serialize() }}
<html>
@components.Head()
<body
class="container"
data-commit={ templ.JSONString(ctx.Value("commit")) }
data-user={ templ.JSONString(u) }
data-wallet={ templ.JSONString(w) }
data-nwc={ templ.JSONString(nwc) }
>
<div id="content" class="grid mt-3">
<div class="grid gap-10 self-center justify-self-center">
<h1 class="text-center text-5xl font-bold">{ fmt.Sprintf("%d sats", w.Msats) }</h1>
<div class="flex justify-self-center">
<button class="flex items-center justify-center text-xl mx-3 w-[120px]">
<img src="/svg/arrow-left-down-line.svg" width="24px" height="24px"/>
receive
</button>
<button class="flex items-center justify-center text-xl mx-3 w-[120px]">
<img src="/svg/arrow-right-up-line.svg" width="24px" height="24px"/>
send
</button>
</div>
</div>
</div>
</body>
</html>
}