{#
/**
 * @file
 * Cache insights side panel.
 *
 * Available variables:
 * - insights: Cache insights payload.
 */
#}

<article class="no-cache-insights">
  <div class="no-cache-insights__header">
    <h3 class="no-cache-runtime-health__section-title">{{ insights.title|default('Cache Insights'|t) }}</h3>
  </div>

  {% if insights.items is not empty %}
    <ul class="no-cache-insights__list">
      {% for item in insights.items %}
        <li class="no-cache-insights__item">
          <span class="no-cache-insights__bullet">◆</span>

          <div class="no-cache-insights__content">
            {% if item.title is defined and item.title %}
              <div class="no-cache-insights__title">{{ item.title }}</div>
            {% endif %}

            {% if item.description is defined and item.description %}
              <div class="no-cache-insights__text">{{ item.description }}</div>
            {% elseif item.message is defined and item.message %}
              <div class="no-cache-insights__text">{{ item.message }}</div>
            {% else %}
              <div class="no-cache-insights__text">{{ 'Insight available.'|t }}</div>
            {% endif %}
          </div>
        </li>
      {% endfor %}
    </ul>
  {% else %}
    <div class="no-cache-insights__empty">
      {{ 'No cache insights are currently available for the selected range.'|t }}
    </div>
  {% endif %}
</article>
