{% from "_macros.html" import icon %}
{#
  The share panel's placeholder on a detail page.

  It fetches `_share_panel.html` on load rather than being rendered inline, and
  that is the whole change: the panel used to be checkboxes inside the
  resource's *save form*, so a share only happened if you also saved the
  resource, and the list of candidates was every group and every account on the
  instance, unpaginated, on every detail page.

  Sharing still grants *reading*. Two people editing one note with no history and
  no merge is worse than the inconvenience of copying it, so there is no "can
  edit" and its absence is deliberate rather than missing.

  Only the owner sees it at all — someone a thing was shared with cannot share it
  onward — and the route enforces that as well, because a template is not a
  permission check.
#}
{% if is_owner and can_share %}
<div hx-get="/api/library/share/{{ share_kind }}/{{ share_id }}"
     hx-trigger="load"
     hx-target="this"
     hx-swap="outerHTML">
  <section class="card">
    <h2 class="card__title">Shared with <span class="badge">…</span></h2>
  </section>
</div>
{% elif not is_owner %}
<div class="alert">
  {{ icon("users", "alert__icon") }}
  <span>Shared with you. You can read this but not change it.</span>
</div>
{% endif %}
