{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
{% import '@SyliusShop/Macro/table.html.twig' as table %}

{% set definition = grid.definition %}
{% set data = grid.data %}

{% if data|length > 0 %}
    <table class="table table-bordered" {{ sylius_test_html_attribute('grid-table') }}>
        <thead>
            <tr>
                {{ table.headers(grid, definition, app.request.attributes) }}
            </tr>
        </thead>
        <tbody {{ sylius_test_html_attribute('grid-table-body') }}>
            {% for row in data %}
                {{ table.row_responsive(grid, definition, row) }}
            {% endfor %}
        </tbody>
    </table>
{% else %}
    {{ messages.info('sylius.ui.no_results_to_display') }}
{% endif %}

{{ pagination.simple(data) }}
