{% import 'ohmyadmin/lib/forms.html' as forms %}

<section class="row-form-layout">
    <header>
        <h3>{{ layout.label }}</h3>
        {% if layout.description %}
            <p>{{ layout.description }}</p>
        {% endif %}
    </header>

    <main>
        {% for child in layout.children %}
            <div class="form-input-row">
                <label for="{{ child.field.label.field_id }}">
                    {{ child.field.label.text }}
                    {% if child.field.flags.required %}
                        {{ forms.required_asterisk() }}
                    {% endif %}
                </label>
                <div class="max-w-{{ child.max_width }} md:col-span-2">
                    {{ forms.form_input(child.field) }}
                    {{ forms.form_help(child.field) if child.field.description else '' }}
                    {{ forms.form_errors(child.field) if child.field.errors else '' }}
                </div>
            </div>
            <div class="form-input-separator"></div>
        {% endfor %}
    </main>
</section>
