{% for msg_card in response %}
    <tr><td class="raw-icons">
        {% if msg_card.get("url") %}
          {% if msg_card.get("app_icon") and size in ("medium", "large", "extra-large") %}
          <a href="{{msg_card['url']}}"><img src="{{msg_card['app_icon']}}"></a>
          {% else %}
          <a href="{{msg_card['url']}}">Link</a>
          {% endif %}
        {% else %}
          {% if msg_card.get("app_icon") and size in ("medium", "large", "extra-large") %}
          <img src="{{msg_card['app_icon']}}">
          {% endif %}
        {% endif %}
        {% if msg_card.get("agent_avatar") and size in ("large", "extra-large") %}
        <img src="{{msg_card['agent_avatar']}}">
        {% endif %}
      </td>
        <td class="raw-message">
          <a href="{{url_for('raw')}}?topic={{msg_card['topic']}}"><b>{{ msg_card['topic'] }}</b></a>
          {% if size in ("medium", "large", "extra-large") %}
          {{ msg_card["summary"] }}
          {% endif %}
          <a href="{{url_for('msg_id')}}?id={{msg_card['msg_id']}}&is_raw=true&size=extra-large">
            <span class="details-history">JSON</span>
          </a>
        {% if is_raw %}
            <a href="#" onclick="history.go(-1)">Go Back</a>
        {% endif %}
        </td>

    <td class="datetime">
        {{ msg_card["date"] }}
        {% if size in ('large', 'extra-large') %} - {{ msg_card["timestamp"].strftime('%Y-%m-%d %H:%M:%S') }} UTC{% endif %}
    </td>
          </tr>
{% endfor %}
