xtablo-source/deprecated/internal/web/ui/form_field.templ
Arthur Belleville 5d0c201e86
Some checks failed
backend-ci / Backend tests (pull_request) Failing after 53s
backend-ci / Backend tests (push) Failing after 1s
Some work
2026-05-23 17:26:01 +02:00

26 lines
502 B
Text

package ui
type FormFieldProps struct {
Label string
For string
Field templ.Component
Error string
Hint string
}
templ FormField(props FormFieldProps) {
<div class="ui-form-field">
if props.Label != "" {
<label for={ props.For } class="ui-form-label">{ props.Label }</label>
}
if props.Field != nil {
@props.Field
}
if props.Hint != "" {
<p class="ui-form-hint">{ props.Hint }</p>
}
if props.Error != "" {
<p class="ui-form-error">{ props.Error }</p>
}
</div>
}