<div class="container">
    {% for send in sends %}
        <div class="row row-hover align-items-center">
            <div class="col-sm-12 col-md-5">
                {% if send.destineeKind == 'thirdParty' %}
                    {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
                        action: 'show', displayBadge: true,
                        targetEntity: { name: 'thirdParty', id: send.destineeThirdParty.id },
                        buttonText: send.destineeThirdParty|chill_entity_render_string,
                    } %}
                {% else %}
                    <a href="mailto:{{ send.destineeEmail }}">{{ send.destineeEmail }}</a>
                {% endif %}
                {% if not send.expired %}
                    <p><small>{{ 'workflow.send_external_message.document_available_until'|trans({'expiration': send.expireAt}) }}</small></p>
                {% endif %}
            </div>
            <div class="col-sm-12 col-md-7 text-end">
                <p><small>{{ 'workflow.external_views.number_of_views'|trans({'numberOfViews': send.views|length}) }}</small></p>
                 {% if send.views|length > 0 %}
                     <p><small>{{ 'workflow.external_views.last_view_at'|trans({'at': send.lastView.viewAt }) }}</small></p>
                     <p>
                         <small>
                             <b>{{ 'workflow.public_views_by_ip'|trans }}&nbsp;:</b>
                             {%- for ip, vs in send.viewsByIp -%}
                                 <span title="{% for v in vs %}{{ v.viewAt|format_datetime('short', 'short')|escape('html_attr') }}{% if not loop.last %}{{ ', '|escape('html_attr') }}{% endif %}{% endfor %}">{{ ip }} ({{ vs|length }}x)</span>
                             {%- endfor -%}
                         </small>
                     </p>

                 {% endif %}
            </div>
        </div>
    {% endfor %}
</div>
