fix: no proper loading feedback on forms
This commit is contained in:
parent
cbb14ffba2
commit
d224f5a10a
27 changed files with 192 additions and 57 deletions
22
internal/ui/components/button/submit.templ
Normal file
22
internal/ui/components/button/submit.templ
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package button
|
||||
|
||||
import "git.juancwu.dev/juancwu/budgit/internal/ui/components/icon"
|
||||
|
||||
templ Submit(props ...Props) {
|
||||
{{ var p Props }}
|
||||
if len(props) > 0 {
|
||||
{{ p = props[0] }}
|
||||
}
|
||||
if p.Type == "" {
|
||||
{{ p.Type = TypeSubmit }}
|
||||
}
|
||||
{{ p.Class = p.Class + " htmx-submit-btn" }}
|
||||
@Button(p) {
|
||||
<span class="btn-label contents">
|
||||
{ children... }
|
||||
</span>
|
||||
<span class="btn-spinner">
|
||||
@icon.LoaderCircle(icon.Props{Class: "animate-spin"})
|
||||
</span>
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue