<div [@routerTransition]>
 
    <div class="kt-content  kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor">
        <div class="kt-subheader kt-grid__item">
            <div [class]="containerClass">
                <div class="kt-subheader__main">
                    <h3 class="kt-subheader__title">
                            <span>{{"OrderStatus" | localize}}</span>
                    </h3>
                    <span class="kt-subheader__separator kt-subheader__separator--v"></span>
                    <span class="kt-subheader__desc">
                            {{"OrderStatusManagement" | localize}}
                    </span>
                </div>
                <div class="kt-subheader__toolbar">
                    <div class="kt-subheader__wrapper">
                        <button (click)="createOrderStatusModal()" *ngIf="isGranted('Pages.Orders.Status.Create')" class="btn btn-primary btn-elevate btn-pill"><i class="fa fa-plus"></i> {{"OrderStatusCreate" | localize}}</button>
                        <!-- <button (click)="createTag()" *ngIf="isGranted('Pages.Orders.Create')" class="btn btn-primary btn-elevate btn-pill btn-elevate-air"><i class="fa fa-plus"></i> {{"TagCreate" | localize}}</button> -->
                    </div>
                </div>
            </div>
        </div>
        <div [class]="containerClass + ' kt-grid__item kt-grid__item--fluid'">
            <div class="kt-portlet kt-portlet--mobile">
                <div class="kt-portlet__body">
                    <form (submit)="getOrderStatus()" autocomplete="off" class="kt-form" >
                        <div class="row align-items-center mb-4">
                            <div class="col-md-12">
                                <div class="kt-searchbar">
                                    <div class="kt-input-icon kt-input-icon--right">
                                            <input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input" [placeholder]="l('OrderId')" type="text">
                                            <span class="kt-input-icon__icon kt-input-icon__icon--right">
                                            <span class="" id="basic-addon1"><i class="flaticon-search"></i></span>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="row align-items-center">
                        <!--<Primeng-TurboTable-Start>-->
                        <div class="col-xl-12">
                            <div class="primeng-datatable-container" >
                                <p-table #dataTable
                                        (onLazyLoad)="getOrderStatus($event)"
                                        [value]="primengTableHelper.records"
                                        rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
                                        [paginator]="false"
                                        [lazy]="true"
                                        [scrollable]="true"
                                        ScrollWidth="100%"
                                        [responsive]="primengTableHelper.isResponsive"
                                        [resizableColumns]="primengTableHelper.resizableColumns">
                                    <ng-template pTemplate="header">
                                        <tr>
                                            <th style="width: 130px" >{{'Actions' | localize}}</th>
                                            <th style="width: 130px" pSortableColumn="id">
                                                {{'Id' | localize}}
                                                <p-sortIcon field="id"></p-sortIcon>
                                            </th>
                                            <th style="width: 150px" pSortableColumn="orderId">
                                                {{'OrderId' | localize}}
                                                <p-sortIcon field="orderId"></p-sortIcon>
                                            </th>
                                            <th style="width: 150px" pSortableColumn="orderStatusType.sortOrder">
                                                {{'Status' | localize}}
                                                <p-sortIcon field="orderStatusType.sortOrder"></p-sortIcon>
                                            </th>
                                        </tr>
                                    </ng-template>
                                    <ng-template pTemplate="body" let-record="$implicit">
                                        <tr>
                                            <td style="width: 130px"
                                                [hidden]="!isGrantedAny('Pages.Orders.Status.Update', 'Pages.Orders.Status.Delete')">
                                                <div class="btn-group dropdown" dropdown container="body">
                                                    <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary btn-elevate btn-pill">
                                                        <i class="fa fa-cog"></i><span class="caret"></span> {{"Actions" | localize}}
                                                    </button>
                                                    <ul class="dropdown-menu" *dropdownMenu>
                                                        <!-- <li>
                                                            <a href="javascript:;" *ngIf="'Pages.Orders.Status.Edit' | permission"
                                                            (click)="updateOrderPackageModal.show(record)">{{'Edit' | localize}}</a>
                                                        </li> -->
                                                        <li>
                                                            <a href="javascript:;" *ngIf="'Pages.Orders.Status.Delete' | permission"
                                                            (click)="deleteStatus(record.id)">{{'Delete' | localize}}</a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </td>
                                            <td style="width: 130px">
                                                <span class="ui-column-title"> {{'Id' | localize}}</span>
                                                {{record.id}}
                                            </td>
                                            <td style="width: 150px">
                                                <span class="ui-column-title"> {{'OrderId' | localize}}</span>
                                                {{record.order.id}}
                                            </td>
                                            <td style="width: 150px">
                                                <span class="ui-column-title"> {{'Status' | localize}}</span>
                                                {{record.orderStatusType.description}}
                                            </td>
                                        </tr>
                                    </ng-template>
                                </p-table>
                                <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                    {{'NoData' | localize}}
                                </div>
                                <div class="primeng-paging-container">
                                    <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage"
                                                #paginator
                                                (onPageChange)="getOrderStatus($event)"
                                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">

                                    </p-paginator>
                                    <span class="total-records-count">
                                        {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                                    </span>
                                </div>
                            </div>
                        </div>
                        <!--<Primeng-TurboTable-End>-->
                    </div>
                </div>
            </div>
        </div>

    <createOrderStatus #createOrderStatus (modalSave)="getOrderStatus()"></createOrderStatus>
    <!-- <updateOrderPackageModal #updateOrderPackageModal (modalSave)="getOrderStatus()"></updateOrderPackageModal> -->
    </div>
</div>
