<!-- web/ui/partials/buttons.html -->
{{ define "buttons" }}
<div class="products">
  <h2>{{ T "products.title" }}</h2>
  <div id="buttons-grid" class="grid">
    {{ range .Buttons }}
      <button
        class="btn-tile"
        hx-post="/api/pos/scan"
        hx-vals='{"code":"{{ .Code }}"}'
        hx-trigger="click"
        hx-target="#basket"
        hx-swap="outerHTML">
        {{ if .ImageURL }}<img class="thumb" src="{{ imgv .ImageURL }}" alt="" loading="lazy" />{{ end }}
        <span class="tile-name">{{ .Label }}</span>
        {{ if .Price }}<span class="tile-price">{{ money .Price }}</span>{{ end }}
      </button>
    {{ else }}
      <p class="empty">{{ T "products.empty" }}</p>
    {{ end }}
  </div>
  <!-- Action buttons contributed by installed plugins -->
  <div hx-get="/ui/plugin-buttons" hx-trigger="load" hx-swap="outerHTML"></div>
</div>
{{ end }}
