{{ define "journal" }}
<div class="journal" id="journal" {{ if .OOB }}hx-swap-oob="true"{{ end }}>
  <h2>{{ T "journal.title" }}</h2>
  {{ if .Entries }}
    <table>
      <thead>
        <tr><th>{{ T "journal.col.receipt" }}</th><th>{{ T "journal.col.total" }}</th><th>{{ T "journal.col.tender" }}</th><th>{{ T "journal.col.sync" }}</th><th>{{ T "journal.col.time" }}</th></tr>
      </thead>
      <tbody>
        {{ range .Entries }}
          <tr class="journal-row" onclick="window.location='/journal/' + this.dataset.receipt" data-receipt="{{ .ReceiptNo }}">
            <td><a href="/journal/{{ .ReceiptNo }}" onclick="event.stopPropagation()">{{ .ReceiptNo }}</a></td>
            <td>{{ money .Total }}</td>
            <td>{{ .TenderType }}</td>
            <td>{{ .SyncStatus }}</td>
            <td>{{ .CreatedAt }}</td>
          </tr>
        {{ end }}
      </tbody>
    </table>
  {{ else }}
    <div class="empty">{{ T "journal.empty" }}</div>
  {{ end }}
</div>
{{ end }}
