init go project
This commit is contained in:
commit
5dde43e409
85 changed files with 16720 additions and 0 deletions
43
internal/ui/components/label/label.templ
Normal file
43
internal/ui/components/label/label.templ
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// templui component label - version: v0.101.0 installed by templui v0.101.0
|
||||
// 📚 Documentation: https://templui.io/docs/components/label
|
||||
package label
|
||||
|
||||
import "git.juancwu.dev/juancwu/budgething/internal/utils"
|
||||
|
||||
type Props struct {
|
||||
ID string
|
||||
Class string
|
||||
Attributes templ.Attributes
|
||||
For string
|
||||
Error string
|
||||
}
|
||||
|
||||
templ Label(props ...Props) {
|
||||
{{ var p Props }}
|
||||
if len(props) > 0 {
|
||||
{{ p = props[0] }}
|
||||
}
|
||||
<label
|
||||
if p.ID != "" {
|
||||
id={ p.ID }
|
||||
}
|
||||
if p.For != "" {
|
||||
for={ p.For }
|
||||
}
|
||||
class={
|
||||
utils.TwMerge(
|
||||
"text-sm font-medium leading-none inline-block",
|
||||
utils.If(len(p.Error) > 0, "text-destructive"),
|
||||
p.Class,
|
||||
),
|
||||
}
|
||||
data-tui-label-disabled-style="opacity-50 cursor-not-allowed"
|
||||
{ p.Attributes... }
|
||||
>
|
||||
{ children... }
|
||||
</label>
|
||||
}
|
||||
|
||||
templ Script() {
|
||||
<script defer nonce={ templ.GetNonce(ctx) } src={ "/assets/js/label.min.js?v=" + utils.ScriptVersion }></script>
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue