{{inject 'noCompareMessage' (lang 'compare.no_compare')}}

{{#if category.products}}
    {{> components/products/filter sort=pagination.category.sort}}

    <div data-list-name="Category: {{category.name}}" role="region" aria-label="{{lang 'category.product_label'}}">
        {{#if theme_settings.product_list_display_mode '===' 'grid'}}
            {{> components/products/grid products=category.products show_compare=category.show_compare theme_settings=theme_settings event="list" }}
        {{else}}
            {{> components/products/list products=category.products show_compare=category.show_compare theme_settings=theme_settings event="list" }}
        {{/if}}
    </div>

    {{> components/common/paginator pagination.category}}
{{else}}
    {{#if category.search_error}}
        <p>{{lang 'search.errorMessage'}}</p>
    {{else}}
        <p data-no-products-notification
           role="alert"
           aria-live="assertive"
           tabindex="-1"
        >
            {{lang 'categories.no_products'}}
        </p>
    {{/if}}
{{/if}}
