{% if courses.enrolled.any? %}
  {% assign completed_courses = courses.enrolled | map: "completed?" %}
  {% assign any_completed = false %}

  {% for completed_course in completed_courses %}
    {% if completed_course %}
      {% assign any_completed = true %}
    {% endif %}
  {% endfor %}

  {% if any_completed %}
    {% assign any_course = false %}
    <div class="row row-with-thumbnails">
      {% for course in courses.enrolled %}
        {% if course.completed? %}
          {% assign is_course_from_learning_path = false %}
          {% for lp_courses in learning_path_courses %}
            {% for lp_course in lp_courses %}
              {% if lp_course.id == course.id %}
                {% assign is_course_from_learning_path = true %}
              {% endif %}
            {% endfor %}
          {% endfor %}

          {% unless is_course_from_learning_path %}
            <div class="{{ class }}">
              {% include "cards_course" with course %}
            </div>
            {% assign any_course = true %}
          {% endunless %}
        {% endif %}
      {% endfor %}
      </div>
      {% unless any_course %}
        {% include "courses_zero_state", message: "Yikes! You don’t have any Completed Courses." %}
      {% endunless %}
    {% else %}
      {% include "courses_zero_state", message: "Yikes! You don’t have any Completed Courses." %}
  {% endif %}
{% else %}
  {% include "courses_zero_state", message: "Yikes! You don’t have any Completed Courses." %}
{% endif %}
