<vdr-data-table-2
    [id]="locationId"
    [items]="members"
    [itemsPerPage]="membersItemsPerPage$ | async"
    [totalItems]="totalItems"
    [currentPage]="membersCurrentPage$ | async"
    (pageChange)="setContentsPageNumber($event)"
    (itemsPerPageChange)="setContentsItemsPerPage($event)"
>
    <vdr-bulk-action-menu
        [locationId]="locationId"
        [hostComponent]="this"
        [selectionManager]="selectionManager"
    ></vdr-bulk-action-menu>
    <vdr-dt2-search
        [searchTermControl]="filterTermControl"
        [searchTermPlaceholder]="'customer.search-customers-by-email' | translate"
    ></vdr-dt2-search>
    <vdr-dt2-column [heading]="'common.id' | translate" id="id" [hiddenByDefault]="true">
        <ng-template let-customerGroup="item">
            {{ customerGroup.id }}
        </ng-template>
    </vdr-dt2-column>
    <vdr-dt2-column [heading]="'common.created-at' | translate" id="created-at" [hiddenByDefault]="true">
        <ng-template let-customer="item">
            {{ customer.createdAt | localeDate : 'short' }}
        </ng-template>
    </vdr-dt2-column>
    <vdr-dt2-column [heading]="'common.updated-at' | translate" id="updated-at" [hiddenByDefault]="true">
        <ng-template let-customer="item">
            {{ customer.createdAt | localeDate : 'short' }}
        </ng-template>
    </vdr-dt2-column>
    <vdr-dt2-column [heading]="'customer.name' | translate" id="name" [optional]="false">
        <ng-template let-customer="item">
            <a class="button-ghost" [routerLink]="['/customer/customers', customer.id]"
                ><span> {{ customer.title }} {{ customer.firstName }} {{ customer.lastName }} </span>
                <clr-icon shape="arrow right"></clr-icon>
            </a>
        </ng-template>
    </vdr-dt2-column>
    <vdr-dt2-column [heading]="'common.status' | translate" id="status" [hiddenByDefault]="true">
        <ng-template let-customer="item">
            <vdr-customer-status-label [customer]="customer" />
        </ng-template>
    </vdr-dt2-column>
    <vdr-dt2-column [heading]="'customer.email-address' | translate" id="email-address">
        <ng-template let-customer="item">
            {{ customer.emailAddress }}
        </ng-template>
    </vdr-dt2-column>
</vdr-data-table-2>
