<!--
    <vdr-action-bar>
        <vdr-ab-right>
        </vdr-ab-right>
    </vdr-action-bar>
-->

<vdr-data-table
    [items]="items$ | async"
    [itemsPerPage]="itemsPerPage$ | async"
    [totalItems]="totalItems$ | async"
    [currentPage]="currentPage$ | async"
    (pageChange)="setPageNumber($event)"
    (itemsPerPageChange)="setItemsPerPage($event)"
>
    <vdr-dt-column>{{ 'common.ID' | translate }}</vdr-dt-column>
    <vdr-dt-column>{{ 'common.code' | translate }}</vdr-dt-column>
    <vdr-dt-column>{{ 'order.customer' | translate }}</vdr-dt-column>
    <vdr-dt-column>{{ 'order.state' | translate }}</vdr-dt-column>
    <vdr-dt-column>{{ 'order.total' | translate }}</vdr-dt-column>
    <vdr-dt-column>{{ 'common.updated-at' | translate }}</vdr-dt-column>
    <vdr-dt-column></vdr-dt-column>
    <ng-template let-order="item">
        <td class="left">{{ order.id }}</td>
        <td class="left">{{ order.code }}</td>
        <td class="left"><vdr-customer-label [customer]="order.customer"></vdr-customer-label></td>
        <td class="left">{{ order.state }}</td>
        <td class="left">{{ order.total / 100 | currency: order.currencyCode }}</td>
        <td class="left">{{ order.updatedAt | date: 'medium' }}</td>
        <td class="right">
            <vdr-table-row-action
                iconShape="shopping-cart"
                [label]="'common.open' | translate"
                [linkTo]="['./', order.id]"
            ></vdr-table-row-action>
        </td>
    </ng-template>
</vdr-data-table>
