{% load crispy_forms_field %}

{% if field.is_hidden %}
    {{ field }}
{% else %}
    {% if field|is_checkbox %}
        <div id="div_{{ field.auto_id }}" class="form-control inline-flex{% if wrapper_class %} {{ wrapper_class }}{% endif %}">
            <label class="label cursor-pointer gap-2">
            {% crispy_field field 'class' 'checkbox' %}
            <span class="label-text">{{ field.label }}</span>
            </label>
        </div>
    {% else %}
        <div id="div_{{ field.auto_id }}"{% if wrapper_class %} class="{{ wrapper_class }}"{% endif %}>
            <label for="{{ field.id_for_label }}" class="sr-only">
                {{ field.label }}
            </label>
            {% if field.errors %}
                {% crispy_field field 'class' 'input input-bordered input-error' 'placeholder' field.label %}
            {% else %}
                {% crispy_field field 'class' 'input input-bordered' 'placeholder' field.label %}
            {% endif %}
            
        </div>
    {% endif %}
{% endif %}
