package customtextfield

import "cpone/models"

templ CustomTextFieldv2(inp models.CustomTextFieldv2Prm) {
	<div class="form-group">
		<label
			if inp.Type == "hidden" {
				class="text-black d-none"
			} else {
				class="text-black"
			}
			style="font-family: Poppins; font-weight: 600;"
		>{ inp.Label } </label>
		<input
			id={ inp.Name }
			name={ inp.Name }
			type={ inp.Type }
			placeholder={ inp.Placeholder }
			value={ inp.Value }
			if inp.ErrorMsg =="" {
				class="form-control bg-field border-0 form-control-lg bg-field rounded-lg"
			} else {
				class="form-control bg-field border-1 form-control-lg bg-field rounded-lg is-invalid"
			}
		/>
		<div class="invalid-feedback text-danger mt-3 ml-2">
			{ inp.ErrorMsg }
		</div>
	</div>
}
