{% extends 'django_spire/filtering/form/base_session_filter_form.html' %}

{% load session_tags %}

{% block session_filter_key %}{{ filter_session.session_key }}{% endblock %}

{% block filter_content %}
    <div
        class="row g-2 mb-2"
        x-data="{
            async init() {
                this.search_field.set_attribute('placeholder', 'Search...')
            },

            session_controller: new SessionController('{% session_controller_to_json filter_session.session_key %}'),
            search_field: new GlueCharField(
                'search',
                {
                    value: '{{ filter_session.search|default:"" }}',
                    label: 'Search',
                    name: 'search',
                }
            ),
        }"
    >
        <div class="col-3">
            {% include 'django_glue/form/field/char_field.html' with glue_field='search_field' %}
        </div>
    </div>
{% endblock %}
