{%- import 'networks/_spt_macros.html' as macros_whois with context -%}
{%- set content_id = get_uuid4() -%}
<div class="popover-hover" role="button" data-popover-content="#po-{{ content_id }}">
    <span class="badge text-bg-secondary">
        {{ get_icon('module-networks') }} | {{ search_result[-1].get('abuse_group', _('-- undefined --')) }}{% if search_result|length > 1 %} ({{ _('%(cnt)d more', cnt = (search_result|length -1)) }}){% endif %}
    </span>
    <div id="po-{{ content_id }}" class="d-none">
        <div class="popover top">
            <div class="popover-arrow" data-popper-arrow></div>
            <h3 class="popover-title">
                <a href="{{ url_for('host_info.search', submit = _('Search'), search = search_item) }}" data-bs-toggle="tooltip" title="{{ _('Go to full search page') }}">
                    {{ macros_whois.get_title() }}
                </a>
                <span class="float-end">
                    <span data-bs-toggle="tooltip" title="{{ _('Query time') }}: {{ get_timedelta(g.requeststart) }}">
                        {{ get_icon('stopwatch') }}
                    </span>
                </span>
            </h3>
            <div class="popover-content">
                <table class="table table-sm">
                    <tr>
                        <th></th>
                        <th>{{ _('Network') }}</th>
                        <th>{{ _('Netname') }}</th>
                        <th>{{ _('Contacts') }}</th>
                    </tr>
    {%- for sritem in search_result %}
                    <tr>
                        <td>{{ loop.index }}</td>
                        <td>{% if 'network' in sritem %}{{ sritem['network'] }}{% endif %}</td>
                        <td>{% if 'netname' in sritem %}{{ sritem['netname'] }}{% endif %}</td>
                        <td>{% if 'abuse_group' in sritem %}{{ sritem['abuse_group'] }}{% endif %}</td>
                    </tr>
    {%- endfor %}
                </table>
            </div>
        </div>
    </div>
</div>
