{% extends "staff/base.html" %}

{% block title %}
{%- if global_search_query -%}
Search results for "{{ global_search_query }}"
{%- else -%}
Search
{%- endif -%}
{% endblock %}

{% block content %}

{% if global_search_query %}
<div class="*:mt-14 *:empty:mt-0">
    {% for view in searchable_views %}
    <div
        hx-get="{{ view.get_absolute_url() }}?search={{ global_search_query }}&page_size=5"
        hx-trigger="plainhtmx:load from:body"
        plain-hx-fragment="list">
    </div>
    {% endfor %}
</div>
{% else %}
<p class="text-stone-500">Enter a search query in the top bar</p>
{% endif %}

{% endblock %}
