{% assign uniq_courses = '' %}
{% assign course_counter = 0 %}
{% assign learner_region = current_person.properties.person_locale %}


{% if courses.in_catalog.any? %}
  <div class="np-catalog-courses row row-with-thumbnails">
    {% for course in courses.in_catalog %}
      {% for category in course.categories %}
        {% unless category.name == 'Blog' %}
          {% unless uniq_courses contains course.name %}
              {% if course.properties.course_locale == learner_region %}
                <div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content card-course-container">
                  {% include "cards_course" with course %}
                </div>
              {% assign uniq_courses = uniq_courses |  append: course.name %} 
              {% assign course_counter = course_counter |  plus: 1 %}
              {% endif %}
          {% endunless %}
        {% endunless %}
      {% endfor %}
    {% endfor %}
  </div>

  {% if course_counter == 0 %}
    {% capture message %}
      {% t shared.zero_state.courses.catalog,
        key: current_school.course_vocabulary
      %}
    {% endcapture %}
    {% include "grow-with-walmart-zero-state", message: message %}
  {% endif %}
{% endif %}
