<!-- admin_conversations.pages.tmpl -->
{{ define "admin_conversations.pages.tmpl" }}
<h2>Historique des messages de l'utilisateur #{{ .UserID }}</h2>

<div class="mb-3">
  <label>Filtrer par type :</label>
  <select id="filterType" name="type" hx-get="/api/user/{{ .UserID }}/conversations" hx-target="#conversationRows" hx-trigger="change" hx-include="#filterType">
    <option value="">Tous</option>
    <option value="text">Texte</option>
    <option value="image">Image</option>
    <option value="video">Vidéo</option>
    <option value="interactive">Interactif</option>
  </select>
</div>

<table class="table">
  <thead>
    <tr>
      <th>Date</th>
      <th>Direction</th>
      <th>Expéditeur</th>
      <th>Type</th>
      <th>Contenu</th>
      <th>Statut</th>
    </tr>
  </thead>
  <tbody id="conversationRows"
    hx-get="/api/user/{{ .UserID }}/conversations"
    hx-trigger="load"
    hx-target="this"
    hx-swap="innerHTML">
  </tbody>
</table>
<hr>
<h3>Conversation complète</h3>
<div id="threadViewer" class="mt-3"></div>
{{ end }}