1373 lines
64 KiB
Go
1373 lines
64 KiB
Go
|
|
// Code generated by templ - DO NOT EDIT.
|
||
|
|
|
||
|
|
// templ: version: v0.3.977
|
||
|
|
package components
|
||
|
|
|
||
|
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||
|
|
|
||
|
|
import "github.com/a-h/templ"
|
||
|
|
import templruntime "github.com/a-h/templ/runtime"
|
||
|
|
|
||
|
|
type TxType string
|
||
|
|
|
||
|
|
const (
|
||
|
|
TxTypeSend TxType = "send"
|
||
|
|
TxTypeReceive TxType = "receive"
|
||
|
|
TxTypeSwap TxType = "swap"
|
||
|
|
TxTypeApprove TxType = "approve"
|
||
|
|
TxTypeContract TxType = "contract"
|
||
|
|
)
|
||
|
|
|
||
|
|
type TxStatus string
|
||
|
|
|
||
|
|
const (
|
||
|
|
TxStatusConfirmed TxStatus = "confirmed"
|
||
|
|
TxStatusPending TxStatus = "pending"
|
||
|
|
TxStatusFailed TxStatus = "failed"
|
||
|
|
)
|
||
|
|
|
||
|
|
type TransactionDetail struct {
|
||
|
|
Type TxType
|
||
|
|
Title string
|
||
|
|
Description string
|
||
|
|
Asset string
|
||
|
|
AssetColor string
|
||
|
|
ToAsset string
|
||
|
|
ToAssetColor string
|
||
|
|
Amount string
|
||
|
|
AmountUSD string
|
||
|
|
IsPositive bool
|
||
|
|
Time string
|
||
|
|
Date string
|
||
|
|
Status TxStatus
|
||
|
|
Hash string
|
||
|
|
ExplorerURL string
|
||
|
|
}
|
||
|
|
|
||
|
|
type TxStats struct {
|
||
|
|
TotalReceived string
|
||
|
|
ReceivedCount int
|
||
|
|
TotalSent string
|
||
|
|
SentCount int
|
||
|
|
SwapCount int
|
||
|
|
SwapVolume string
|
||
|
|
GasSpent string
|
||
|
|
}
|
||
|
|
|
||
|
|
type TxFilter struct {
|
||
|
|
Types []string
|
||
|
|
Assets []string
|
||
|
|
Accounts []string
|
||
|
|
}
|
||
|
|
|
||
|
|
type TxDateGroup struct {
|
||
|
|
Date string
|
||
|
|
Count int
|
||
|
|
Transactions []TransactionDetail
|
||
|
|
}
|
||
|
|
|
||
|
|
func DefaultTxStats() TxStats {
|
||
|
|
return TxStats{
|
||
|
|
TotalReceived: "15420.50",
|
||
|
|
ReceivedCount: 42,
|
||
|
|
TotalSent: "8234.18",
|
||
|
|
SentCount: 28,
|
||
|
|
SwapCount: 12,
|
||
|
|
SwapVolume: "$4,892.00",
|
||
|
|
GasSpent: "127.45",
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func DefaultTxFilter() TxFilter {
|
||
|
|
return TxFilter{
|
||
|
|
Types: []string{"send", "receive", "swap", "approve", "contract"},
|
||
|
|
Assets: []string{"ETH", "SNR", "USDC", "AVAX"},
|
||
|
|
Accounts: []string{"Main Wallet", "Trading", "Savings"},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func DefaultTxGroups() []TxDateGroup {
|
||
|
|
return []TxDateGroup{
|
||
|
|
{
|
||
|
|
Date: "Today",
|
||
|
|
Count: 3,
|
||
|
|
Transactions: []TransactionDetail{
|
||
|
|
{Type: TxTypeReceive, Title: "Received ETH", Description: "From: 0x742d...35Cb", Asset: "ETH", AssetColor: "#627eea", Amount: "+0.25 ETH", AmountUSD: "$586.25", IsPositive: true, Time: "2:34 PM", Status: TxStatusConfirmed, Hash: "0x8f4a2b1c..."},
|
||
|
|
{Type: TxTypeSwap, Title: "Swapped SNR → USDC", Description: "via Uniswap V3", Asset: "SNR", AssetColor: "linear-gradient(135deg, #17c2ff, #0090ff)", ToAsset: "USDC", ToAssetColor: "#2775ca", Amount: "500 SNR → 248.50 USDC", AmountUSD: "$248.50", IsPositive: false, Time: "11:22 AM", Status: TxStatusConfirmed, Hash: "0x7d3e2a1b..."},
|
||
|
|
{Type: TxTypeApprove, Title: "Approved USDC", Description: "Spender: Uniswap V3 Router", Asset: "USDC", AssetColor: "#2775ca", Amount: "Unlimited", AmountUSD: "—", IsPositive: false, Time: "11:20 AM", Status: TxStatusConfirmed, Hash: "0x1a2b3c4d..."},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
Date: "Yesterday",
|
||
|
|
Count: 2,
|
||
|
|
Transactions: []TransactionDetail{
|
||
|
|
{Type: TxTypeSend, Title: "Sent SNR", Description: "To: sonr1k4m...9p3q", Asset: "SNR", AssetColor: "linear-gradient(135deg, #17c2ff, #0090ff)", Amount: "-500 SNR", AmountUSD: "$250.00", IsPositive: false, Time: "4:18 PM", Status: TxStatusConfirmed, Hash: "0x9f8e7d6c..."},
|
||
|
|
{Type: TxTypeReceive, Title: "Received AVAX", Description: "From: 0xaBcD...1234", Asset: "AVAX", AssetColor: "#e84142", Amount: "+10.00 AVAX", AmountUSD: "$281.50", IsPositive: true, Time: "9:45 AM", Status: TxStatusConfirmed, Hash: "0x2b3c4d5e..."},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
Date: "January 1, 2026",
|
||
|
|
Count: 4,
|
||
|
|
Transactions: []TransactionDetail{
|
||
|
|
{Type: TxTypeSwap, Title: "Swapped ETH → USDC", Description: "via Uniswap V3", Asset: "ETH", AssetColor: "#627eea", ToAsset: "USDC", ToAssetColor: "#2775ca", Amount: "0.5 ETH → 1,172.50 USDC", AmountUSD: "$1,172.50", IsPositive: false, Time: "9:15 AM", Status: TxStatusConfirmed, Hash: "0x3c4d5e6f..."},
|
||
|
|
{Type: TxTypeContract, Title: "Contract Interaction", Description: "Staking Contract: 0x5f3c...8a2b", Asset: "SNR", AssetColor: "linear-gradient(135deg, #17c2ff, #0090ff)", Amount: "-1,000 SNR", AmountUSD: "$500.00 staked", IsPositive: false, Time: "8:30 AM", Status: TxStatusConfirmed, Hash: "0x4d5e6f7a..."},
|
||
|
|
{Type: TxTypeSend, Title: "Sent ETH", Description: "To: 0x9f8e...7d6c", Asset: "ETH", AssetColor: "#627eea", Amount: "-0.15 ETH", AmountUSD: "$351.85", IsPositive: false, Time: "7:22 AM", Status: TxStatusConfirmed, Hash: "0x5e6f7a8b..."},
|
||
|
|
{Type: TxTypeReceive, Title: "Received SNR", Description: "From: sonr1abc...xyz9 (Airdrop)", Asset: "SNR", AssetColor: "linear-gradient(135deg, #17c2ff, #0090ff)", Amount: "+2,500 SNR", AmountUSD: "$1,250.00", IsPositive: true, Time: "12:00 AM", Status: TxStatusConfirmed, Hash: "0x6f7a8b9c..."},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func assetInitial(asset string) string {
|
||
|
|
if len(asset) > 0 {
|
||
|
|
return string(asset[0])
|
||
|
|
}
|
||
|
|
return "?"
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxIcon(txType TxType) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var1 == nil {
|
||
|
|
templ_7745c5c3_Var1 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
var templ_7745c5c3_Var2 = []any{"tx-icon", string(txType)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var3 string
|
||
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var2).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
switch txType {
|
||
|
|
case TxTypeSend:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<wa-icon name=\"arrow-up\"></wa-icon>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
case TxTypeReceive:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<wa-icon name=\"arrow-down\"></wa-icon>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
case TxTypeSwap:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<wa-icon name=\"arrow-right-arrow-left\"></wa-icon>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
case TxTypeApprove:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<wa-icon name=\"check\"></wa-icon>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
case TxTypeContract:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<wa-icon name=\"file-code\"></wa-icon>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxAssetBadge(asset string, color string, toAsset string, toColor string) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var4 == nil {
|
||
|
|
templ_7745c5c3_Var4 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<div class=\"tx-asset\"><wa-avatar initials=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var5 string
|
||
|
|
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(assetInitial(asset))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 139, Col: 43}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" style=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var6 string
|
||
|
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("--size: 24px; background: " + color + ";")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 139, Col: 96}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"></wa-avatar> ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
if toAsset != "" {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<wa-icon name=\"arrow-right\" style=\"font-size: 10px; color: var(--wa-color-neutral-400);\"></wa-icon> <wa-avatar initials=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var7 string
|
||
|
|
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(assetInitial(toAsset))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 142, Col: 46}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" style=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var8 string
|
||
|
|
templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.SanitizeStyleAttributeValues("--size: 24px; background: " + toColor + ";")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 142, Col: 101}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\"></wa-avatar>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<span>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var9 string
|
||
|
|
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(asset)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 144, Col: 16}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</span>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxAmount(amount string, usd string, isPositive bool) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var10 == nil {
|
||
|
|
templ_7745c5c3_Var10 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
var templ_7745c5c3_Var11 = []any{"tx-amount", templ.KV("positive", isPositive), templ.KV("negative", !isPositive)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var11...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<div class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var12 string
|
||
|
|
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var11).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\"><div class=\"value\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var13 string
|
||
|
|
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(amount)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 151, Col: 29}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</div><div class=\"usd\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var14 string
|
||
|
|
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(usd)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 152, Col: 24}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</div></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxTime(time string, status TxStatus) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var15 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var15 == nil {
|
||
|
|
templ_7745c5c3_Var15 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<div class=\"tx-time\"><div class=\"time\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var16 string
|
||
|
|
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(time)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 158, Col: 26}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
switch status {
|
||
|
|
case TxStatusConfirmed:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<wa-badge variant=\"success\" size=\"small\">Confirmed</wa-badge>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
case TxStatusPending:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<wa-badge variant=\"warning\" size=\"small\">Pending</wa-badge>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
case TxStatusFailed:
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<wa-badge variant=\"danger\" size=\"small\">Failed</wa-badge>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxActions(hash string) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var17 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var17 == nil {
|
||
|
|
templ_7745c5c3_Var17 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<div class=\"tx-actions\"><wa-tooltip content=\"View on Explorer\"><wa-icon-button name=\"arrow-up-right-from-square\" label=\"Explorer\"></wa-icon-button></wa-tooltip> <wa-copy-button value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var18 string
|
||
|
|
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hash)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 175, Col: 30}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "\" copy-label=\"Copy hash\"></wa-copy-button></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxRow(tx TransactionDetail) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var19 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var19 == nil {
|
||
|
|
templ_7745c5c3_Var19 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<div class=\"tx-row\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = TxIcon(tx.Type).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<div class=\"tx-details\"><div class=\"tx-type-label\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var20 string
|
||
|
|
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(tx.Title)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 183, Col: 40}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</div><div class=\"tx-address\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var21 string
|
||
|
|
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(tx.Description)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 184, Col: 43}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</div></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = TxAssetBadge(tx.Asset, tx.AssetColor, tx.ToAsset, tx.ToAssetColor).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = TxAmount(tx.Amount, tx.AmountUSD, tx.IsPositive).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = TxTime(tx.Time, tx.Status).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = TxActions(tx.Hash).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxDateGroupComponent(group TxDateGroup) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var22 == nil {
|
||
|
|
templ_7745c5c3_Var22 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<div class=\"date-group\"><div class=\"date-group-header\"><h3>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var23 string
|
||
|
|
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(group.Date)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 196, Col: 19}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</h3><span class=\"tx-count\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var24 string
|
||
|
|
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(formatTxCount(group.Count))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 197, Col: 54}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</span></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
for _, tx := range group.Transactions {
|
||
|
|
templ_7745c5c3_Err = TxRow(tx).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func formatTxCount(count int) string {
|
||
|
|
if count == 1 {
|
||
|
|
return "1 transaction"
|
||
|
|
}
|
||
|
|
return string(rune('0'+count/10)) + string(rune('0'+count%10)) + " transactions"
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxStatsGrid(stats TxStats) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var25 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var25 == nil {
|
||
|
|
templ_7745c5c3_Var25 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<div class=\"wa-grid stats-grid\"><wa-card class=\"stat-card\"><div class=\"wa-stack wa-gap-3xs\"><span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">Total Received</span> <span class=\"wa-heading-l change-positive\">+<wa-format-number type=\"currency\" currency=\"USD\" value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var26 string
|
||
|
|
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(stats.TotalReceived)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 218, Col: 82}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "\" lang=\"en-US\"></wa-format-number></span> <span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var27 string
|
||
|
|
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(formatTxCount(stats.ReceivedCount))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 220, Col: 112}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</span></div></wa-card> <wa-card class=\"stat-card\"><div class=\"wa-stack wa-gap-3xs\"><span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">Total Sent</span> <span class=\"wa-heading-l change-negative\">-<wa-format-number type=\"currency\" currency=\"USD\" value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var28 string
|
||
|
|
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(stats.TotalSent)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 227, Col: 78}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\" lang=\"en-US\"></wa-format-number></span> <span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var29 string
|
||
|
|
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(formatTxCount(stats.SentCount))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 229, Col: 108}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</span></div></wa-card> <wa-card class=\"stat-card\"><div class=\"wa-stack wa-gap-3xs\"><span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">Swaps</span> <span class=\"wa-heading-l\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var30 string
|
||
|
|
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(formatSwapCount(stats.SwapCount))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 235, Col: 65}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</span> <span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var31 string
|
||
|
|
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(stats.SwapVolume)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 236, Col: 94}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, " volume</span></div></wa-card> <wa-card class=\"stat-card\"><div class=\"wa-stack wa-gap-3xs\"><span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">Gas Spent</span> <span class=\"wa-heading-l\"><wa-format-number type=\"currency\" currency=\"USD\" value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var32 string
|
||
|
|
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(stats.GasSpent)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 243, Col: 76}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "\" lang=\"en-US\"></wa-format-number></span> <span class=\"wa-caption-xs\" style=\"color: var(--wa-color-neutral-500);\">All time</span></div></wa-card></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func formatSwapCount(count int) string {
|
||
|
|
if count < 10 {
|
||
|
|
return string(rune('0' + count))
|
||
|
|
}
|
||
|
|
return string(rune('0'+count/10)) + string(rune('0'+count%10))
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxFilterBar(filter TxFilter) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var33 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var33 == nil {
|
||
|
|
templ_7745c5c3_Var33 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "<div class=\"filter-bar\"><wa-select placeholder=\"All Types\" size=\"small\" style=\"min-width: 140px;\" clearable name=\"filter-type\"><wa-option value=\"send\"><wa-icon slot=\"prefix\" name=\"arrow-up\" style=\"color: var(--wa-color-danger);\"></wa-icon> Send</wa-option> <wa-option value=\"receive\"><wa-icon slot=\"prefix\" name=\"arrow-down\" style=\"color: var(--wa-color-success);\"></wa-icon> Receive</wa-option> <wa-option value=\"swap\"><wa-icon slot=\"prefix\" name=\"arrow-right-arrow-left\" style=\"color: var(--wa-color-primary);\"></wa-icon> Swap</wa-option> <wa-option value=\"approve\"><wa-icon slot=\"prefix\" name=\"check\"></wa-icon> Approve</wa-option> <wa-option value=\"contract\"><wa-icon slot=\"prefix\" name=\"file-code\"></wa-icon> Contract</wa-option></wa-select> <wa-select placeholder=\"All Assets\" size=\"small\" style=\"min-width: 140px;\" clearable name=\"filter-asset\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
for _, asset := range filter.Assets {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "<wa-option value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var34 string
|
||
|
|
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(asset)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 284, Col: 28}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var35 string
|
||
|
|
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(asset)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 284, Col: 38}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "</wa-option>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</wa-select> <wa-select placeholder=\"All Accounts\" size=\"small\" style=\"min-width: 160px;\" clearable name=\"filter-account\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
for _, account := range filter.Accounts {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "<wa-option value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var36 string
|
||
|
|
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(account)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 289, Col: 30}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var37 string
|
||
|
|
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(account)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 289, Col: 42}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</wa-option>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "</wa-select> <wa-input type=\"date\" size=\"small\" style=\"width: 150px;\" placeholder=\"From date\" name=\"filter-from\"></wa-input> <span style=\"color: var(--wa-color-neutral-400);\">—</span> <wa-input type=\"date\" size=\"small\" style=\"width: 150px;\" placeholder=\"To date\" name=\"filter-to\"></wa-input><div style=\"flex: 1;\"></div><wa-input placeholder=\"Search by hash or address...\" size=\"small\" style=\"width: 240px;\" name=\"filter-search\"><wa-icon slot=\"prefix\" name=\"magnifying-glass\"></wa-icon></wa-input></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxPagination(page int, total int, perPage int) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var38 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var38 == nil {
|
||
|
|
templ_7745c5c3_Var38 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<div class=\"pagination\"><div class=\"pagination-info\">Showing <strong>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var39 string
|
||
|
|
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(formatRange(page, perPage))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 305, Col: 47}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</strong> of <strong>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var40 string
|
||
|
|
templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(total))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 305, Col: 90}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</strong> transactions</div><div class=\"pagination-controls\"><wa-select value=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var41 string
|
||
|
|
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(formatPerPage(perPage))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 308, Col: 44}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "\" size=\"small\" style=\"width: 100px;\" name=\"limit\"><wa-option value=\"10\">10 / page</wa-option> <wa-option value=\"25\">25 / page</wa-option> <wa-option value=\"50\">50 / page</wa-option> <wa-option value=\"100\">100 / page</wa-option></wa-select><div class=\"page-numbers\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var42 = []any{"page-btn", templ.KV("disabled", page == 1)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var42...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var43 string
|
||
|
|
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var42).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
if page == 1 {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, " disabled")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "><wa-icon name=\"chevron-left\"></wa-icon></button>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = pageButtons(page, totalPages(total, perPage)).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var44 = []any{"page-btn", templ.KV("disabled", page >= totalPages(total, perPage))}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var44...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var45 string
|
||
|
|
templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var44).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
if page >= totalPages(total, perPage) {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, " disabled")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "><wa-icon name=\"chevron-right\"></wa-icon></button></div></div></div>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func formatRange(page int, perPage int) string {
|
||
|
|
start := (page-1)*perPage + 1
|
||
|
|
end := page * perPage
|
||
|
|
return formatTotal(start) + "-" + formatTotal(end)
|
||
|
|
}
|
||
|
|
|
||
|
|
func formatTotal(n int) string {
|
||
|
|
if n < 10 {
|
||
|
|
return string(rune('0' + n))
|
||
|
|
}
|
||
|
|
if n < 100 {
|
||
|
|
return string(rune('0'+n/10)) + string(rune('0'+n%10))
|
||
|
|
}
|
||
|
|
return string(rune('0'+n/100)) + string(rune('0'+(n%100)/10)) + string(rune('0'+n%10))
|
||
|
|
}
|
||
|
|
|
||
|
|
func formatPerPage(n int) string {
|
||
|
|
return formatTotal(n)
|
||
|
|
}
|
||
|
|
|
||
|
|
func totalPages(total int, perPage int) int {
|
||
|
|
return (total + perPage - 1) / perPage
|
||
|
|
}
|
||
|
|
|
||
|
|
func pageButtons(current int, total int) templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var46 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var46 == nil {
|
||
|
|
templ_7745c5c3_Var46 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
if total <= 5 {
|
||
|
|
for i := 1; i <= total; i++ {
|
||
|
|
var templ_7745c5c3_Var47 = []any{"page-btn", templ.KV("active", i == current)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var47...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var48 string
|
||
|
|
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var47).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var49 string
|
||
|
|
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(i))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 354, Col: 82}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "</button>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
var templ_7745c5c3_Var50 = []any{"page-btn", templ.KV("active", current == 1)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var50...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var51 string
|
||
|
|
templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var50).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "\">1</button> ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
if current > 3 {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "<span style=\"padding: 0 var(--wa-space-xs); color: var(--wa-color-neutral-400);\">...</span>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, " ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
if current > 2 && current < total-1 {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, "<button class=\"page-btn\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var52 string
|
||
|
|
templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(current - 1))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 362, Col: 54}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "</button> <button class=\"page-btn active\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var53 string
|
||
|
|
templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(current))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 363, Col: 57}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var53))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "</button> <button class=\"page-btn\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var54 string
|
||
|
|
templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(current + 1))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 364, Col: 54}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "</button>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
} else if current <= 2 {
|
||
|
|
var templ_7745c5c3_Var55 = []any{"page-btn", templ.KV("active", current == 2)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var55...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var56 string
|
||
|
|
templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var55).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var56))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, "\">2</button> ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var57 = []any{"page-btn", templ.KV("active", current == 3)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var57...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var58 string
|
||
|
|
templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var57).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var58))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "\">3</button>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
var templ_7745c5c3_Var59 = []any{"page-btn", templ.KV("active", current == total-2)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var59...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var60 string
|
||
|
|
templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var59).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var60))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var61 string
|
||
|
|
templ_7745c5c3_Var61, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(total - 2))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 369, Col: 96}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var61))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, "</button> ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var62 = []any{"page-btn", templ.KV("active", current == total-1)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var62...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var63 string
|
||
|
|
templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var62).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var64 string
|
||
|
|
templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(total - 1))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 370, Col: 96}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "</button>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, " ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
if current < total-2 {
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, "<span style=\"padding: 0 var(--wa-space-xs); color: var(--wa-color-neutral-400);\">...</span>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, " ")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var65 = []any{"page-btn", templ.KV("active", current == total)}
|
||
|
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var65...)
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "<button class=\"")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var66 string
|
||
|
|
templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var65).String())
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 1, Col: 0}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "\">")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
var templ_7745c5c3_Var67 string
|
||
|
|
templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(formatTotal(total))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `components/transactions.templ`, Line: 375, Col: 89}
|
||
|
|
}
|
||
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "</button>")
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func TxStyles() templ.Component {
|
||
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||
|
|
return templ_7745c5c3_CtxErr
|
||
|
|
}
|
||
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||
|
|
if !templ_7745c5c3_IsBuffer {
|
||
|
|
defer func() {
|
||
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
|
if templ_7745c5c3_Err == nil {
|
||
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||
|
|
}
|
||
|
|
}()
|
||
|
|
}
|
||
|
|
ctx = templ.InitializeContext(ctx)
|
||
|
|
templ_7745c5c3_Var68 := templ.GetChildren(ctx)
|
||
|
|
if templ_7745c5c3_Var68 == nil {
|
||
|
|
templ_7745c5c3_Var68 = templ.NopComponent
|
||
|
|
}
|
||
|
|
ctx = templ.ClearChildren(ctx)
|
||
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, "<style>\n\t\t.tx-icon {\n\t\t\twidth: 40px;\n\t\t\theight: 40px;\n\t\t\tborder-radius: 50%;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.tx-icon.send { background: var(--wa-color-danger-subtle); color: var(--wa-color-danger); }\n\t\t.tx-icon.receive { background: var(--wa-color-success-subtle); color: var(--wa-color-success); }\n\t\t.tx-icon.swap { background: var(--wa-color-primary-subtle); color: var(--wa-color-primary); }\n\t\t.tx-icon.approve { background: var(--wa-color-neutral-100); color: var(--wa-color-neutral-600); }\n\t\t.tx-icon.contract { background: var(--wa-color-warning-subtle); color: var(--wa-color-warning); }\n\t\t\n\t\t.tx-asset {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--wa-space-xs);\n\t\t}\n\t\t\n\t\t.tx-row {\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: auto 1fr auto auto auto auto;\n\t\t\tgap: var(--wa-space-m);\n\t\t\talign-items: center;\n\t\t\tpadding: var(--wa-space-m);\n\t\t\tbackground: var(--wa-color-surface);\n\t\t\tborder-radius: var(--wa-radius-m);\n\t\t\tmargin-bottom: var(--wa-space-s);\n\t\t\ttransition: box-shadow 0.15s;\n\t\t}\n\t\t.tx-row:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }\n\t\t\n\t\t.tx-details { min-width: 0; }\n\t\t.tx-type-label { font-weight: 500; margin-bottom: 2px; }\n\t\t.tx-address {\n\t\t\tfont-family: var(--wa-font-mono);\n\t\t\tfont-size: var(--wa-font-size-xs);\n\t\t\tcolor: var(--wa-color-neutral-500);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t\n\t\t.tx-amount { text-align: right; }\n\t\t.tx-amount .value { font-weight: 500; }\n\t\t.tx-amount .usd { font-size: var(--wa-font-size-xs); color: var(--wa-color-neutral-500); }\n\t\t.tx-amount.positive .value { color: var(--wa-color-success); }\n\t\t.tx-amount.negative .value { color: var(--wa-color-danger); }\n\t\t\n\t\t.tx-time { text-align: right; min-width: 80px; }\n\t\t.tx-time .time { font-size: var(--wa-font-size-s); margin-bottom: 2px; }\n\t\t\n\t\t.tx-actions { display: flex; gap: var(--wa-space-2xs); }\n\t\t\n\t\t.date-group { margin-bottom: var(--wa-space-xl); }\n\t\t.date-group-header {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--wa-space-s);\n\t\t\tpadding: var(--wa-space-s) 0;\n\t\t\tmargin-bottom: var(--wa-space-s);\n\t\t\tborder-bottom: 1px solid var(--wa-color-neutral-200);\n\t\t}\n\t\t.date-group-header h3 {\n\t\t\tmargin: 0;\n\t\t\tfont-size: var(--wa-font-size-s);\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--wa-color-neutral-700);\n\t\t}\n\t\t.tx-count { font-size: var(--wa-font-size-xs); color: var(--wa-color-neutral-500); }\n\t\t\n\t\t.filter-bar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--wa-space-m);\n\t\t\tmargin-bottom: var(--wa-space-l);\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t\n\t\t.pagination {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: var(--wa-space-m) 0;\n\t\t\tmargin-top: var(--wa-space-l);\n\t\t\tborder-top: 1px solid var(--wa-color-neutral-200);\n\t\t}\n\t\t.pagination-info { font-size: var(--wa-font-size-s); color: var(--wa-color-neutral-500); }\n\t\t.pagination-controls { display: flex; align-items: center; gap: var(--wa-space-xs); }\n\t\t.page-numbers { display: flex; gap: var(--wa-space-2xs); }\n\t\t.page-btn {\n\t\t\tmin-width: 32px;\n\t\t\theight: 32px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: var(--wa-radius-s);\n\t\t\tfont-size: var(--wa-font-size-s);\n\t\t\tcursor: pointer;\n\t\t\tborder: 1px solid var(--wa-color-neutral-200);\n\t\t\tbackground: var(--wa-color-surface);\n\t\t\tcolor: var(--wa-color-neutral-700);\n\t\t\ttransition: all 0.15s;\n\t\t}\n\t\t.page-btn:hover:not(:disabled) { background: var(--wa-color-surface-alt); }\n\t\t.page-btn.active { background: var(--wa-color-primary); border-color: var(--wa-color-primary); color: white; }\n\t\t.page-btn:disabl
|
||
|
|
if templ_7745c5c3_Err != nil {
|
||
|
|
return templ_7745c5c3_Err
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
var _ = templruntime.GeneratedTemplate
|