{% macro render_filters(view) %}
    {% if view.type == 'tablemodel' %}
        <form method="get" class="table-filter-form">
            <tr>
                {% for field_name, config in view.search_params.items() %}
                    <th>
                        {{ view.search_form[field_name]() }}
                    </th>
                {% endfor %}

                {% if view.links %}
                    <th>
                        <button type="submit" class="btn btn-icon btn-info" title="Apply Filters">
                            <i class="ti ti-filter" aria-hidden="true"></i>
                        </button>
                        <!-- Button to clear filters -->
                        <a href="{{ view.request.url.path }}" class="btn btn-icon btn-danger" title="Clear Filters">
                            <i class="ti ti-x" aria-hidden="true"></i>
                        </a>
                    </th>
                {% endif %}
            </tr>
        </form>
    {% endif %}
{% endmacro %}
