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>
}
