package pages
import (
"fmt"
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
"git.ekzyis.com/ekzyis/delphi.market/types"
"strconv"
"time"
)
templ User(user *types.User, errors *types.UserEditError) {
@components.Head()
@components.Nav()
@components.Figlet("random", "user")
id
{ strconv.Itoa(user.Id) }
name
{ user.Name }
if errors != nil && errors.Name != "" {
{ errors.Name }
} else {
}
joined
{ user.CreatedAt.Format(time.DateOnly) }
sats
{ strconv.Itoa(int(user.Msats) / 1000) }
@components.Footer()
}
func maybeShow(class string, show bool) string {
if show {
return class
}
return fmt.Sprintf("%s %s", class, "hidden")
}