{{#if model}}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
{{!-- tombol delete/edit (halaman edit/list) --}}
{{#if (not-eq table.mode "detail")}}
<th width="1%"> </th>
{{/if}}
{{!-- tampilkan header --}}
{{#each table.columns as |column|}}
<th width={{column.width}}>{{column.name}}</th>
{{/each}}
{{!-- tombol delete (halaman edit) --}}
{{#if (eq table.mode "edit")}}
<th width="1%"> </th>
{{/if}}
</tr>
</thead>
<tbody>
{{!-- proses seluruh record --}}
{{#each model as |item|}}
<tr>
{{!-- tombol delete (halaman list) --}}
{{#if (eq table.mode "list")}}
<td style="width: 3%;">
<a href="#" {{action "delete" item}}>
<FaIcon @icon="trash" />
</a>
{{#link-to (concat table.model ".edit") item.id}}
<FaIcon @icon="pencil-alt" />
{{/link-to}}
</td>
{{/if}}
{{!-- tombol edit (halaman edit) --}}
{{#if (eq table.mode "edit")}}
<td>
<a href="#" {{action "editRow" item}}>
<FaIcon @icon="pencil-alt" />
</a>
</td>
{{/if}}
{{!-- proses seluruh kolom --}}
{{#each table.columns as |col|}}
<td data-column={{col.name}} class={{concat "text-" col.align}}>
{{#if (get-property item col.key)}}
{{#if (eq table.mode "detail")}}
{{get-property item col.key}}
{{else}}
{{#if col.uri}}
{{#link-to col.uri item}}
{{get-property item col.key}}
{{/link-to}}
{{else}}
{{get-property item col.key}}
{{/if}}
{{/if}}
{{else}}
{{/if}}
</td>
{{/each}}
{{!-- tombol delete (halaman edit) --}}
{{#if (eq table.mode "edit")}}
<td>
<a href="#" {{action "deleteRow" item}}>
<FaIcon @icon="trash" />
</a>
</td>
{{/if}}
</tr>
{{/each}}
</tbody>
</table>
{{#if showPaging}}
<AppPagination class="mt-2" @page={{ page }} @showPage={{true}} @pagination={{model.meta}} />
{{/if}}
</div>
{{else}}
<h4 class="text-center">Data not found</h4>
{{/if}}