<div class="row">
    <div class="col-xl-12 col-lg-12 col-md-12">
        <div class="card mb-0">
            <div class="card-header border-0 d-flex">
                <div class="d-flex align-items-center">
                    <div class="lh-1"><span class="avatar avatar-sm avatar-rounded bg-info-transparent me-2"><i
                                class="ti ti-ticket fs-16"></i></span></div>
                    <h4 class="card-title">{{'Quotations' | translate}}</h4>
                </div>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <div class="dashboardtabledata table-responsive">
                        <!--Dashboard List-->
                        <div class="table-options">
                            <mat-form-field class="pull-right">
                                <input type="text" matInput (keyup)="applyFilter($event)"
                                    [placeholder]="'search' | translate" #input>
                            </mat-form-field>
                        </div>
                        <div>
                            @if (isloader) {
                            <mat-progress-bar mode="indeterminate"></mat-progress-bar>
                            }
                            <table
                                class="table table-bordered border-bottom text-nowrap ticketdeleterow w-100 dataTable"
                                mat-table [dataSource]="dataSource" matSort>
                                <!-- Sno Column -->
                                <ng-container matColumnDef="id">
                                    <th scope="col" class="wpx-40 text-center" mat-header-cell *matHeaderCellDef
                                        mat-sort-header>
                                        {{'Sl.No' | translate}}
                                    </th>
                                    <td mat-cell *matCellDef="let row; let i = index" class="wpx-40 text-center"> {{i +
                                        1 +
                                        (paginator.pageIndex * paginator.pageSize)}} </td>
                                </ng-container>

                                <!-- invoiceId Column -->
                                <ng-container matColumnDef="invoiceId">
                                    <th scope="col" mat-header-cell *matHeaderCellDef mat-sort-header="invoiceId">
                                        {{ "Invoice Id" | translate}}
                                    </th>
                                    <td mat-cell *matCellDef="let row" class="overflow-hidden ticket-details">
                                        {{row.invoiceId}}
                                    </td>
                                </ng-container>

                                <!-- price Column -->
                                <ng-container matColumnDef="price">
                                    <th scope="col" mat-header-cell *matHeaderCellDef mat-sort-header="price">
                                        {{ "Price" | translate}}
                                    </th>
                                    <td mat-cell *matCellDef="let row" class="overflow-hidden ticket-details">
                                        {{row.ticket_type == 'customInvoice' ? getCurrencyPerTicket(row.amount) :
                                        row.customerAmount}}
                                    </td>
                                </ng-container>

                                <!-- paymentFor Column -->
                                <ng-container matColumnDef="paymentFor">
                                    <th scope="col" mat-header-cell *matHeaderCellDef mat-sort-header="paymentFor">
                                        {{ "Payment For" | translate}}
                                    </th>
                                    <td mat-cell *matCellDef="let row" class="overflow-hidden ticket-details">
                                        {{row.invoiceId}}
                                    </td>
                                </ng-container>

                                <!-- status Column -->
                                <ng-container matColumnDef="status">
                                    <th scope="col" mat-header-cell *matHeaderCellDef mat-sort-header>
                                        {{ "Status" | translate }}
                                    </th>
                                    <td mat-cell *matCellDef="let row">
                                        @if(getStatusElement(row.status)){
                                            <span class="badge" [ngClass]="getStatusElement(row.status)">
                                                {{ getStatusText(row.status) }}
                                            </span>
                                            @if(isPaymentRequired(row.status)){
                                            <span class="text-danger">
                                                {{ 'Payment Required*' | translate}}
                                            </span>
                                            }
                                        }

                                    </td>
                                </ng-container>

                                <!-- Actions Column -->
                                <ng-container matColumnDef="actions">
                                    <th scope="col" mat-header-cell *matHeaderCellDef>
                                        {{ "Actions" | translate}}
                                    </th>
                                    <td mat-cell *matCellDef="let row">
                                        <div>
                                            <a aria-label="View"
                                                routerLink="/customer/custom-invoice/{{row.encrypted_id}}"
                                                href="javascript:;" class="btn btn-sm action-btns"><i
                                                    class="feather feather-eye text-primary" placement="top"
                                                    [ngbTooltip]="'View' | translate"></i></a>
                                        </div>
                                    </td>
                                </ng-container>

                                <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
                                <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>

                                <!-- Row shown when there is no matching data. -->
                                <tr class="mat-row" *matNoDataRow>
                                    @if (!input.value.length) {
                                    <td class="mat-cell text-center" colspan="12">
                                        {{'No data Found'| translate}}
                                    </td>
                                    } @else {
                                    <td class="mat-cell text-center" colspan="12"> {{'No data matching the filter'|
                                        translate}} "
                                        {{input.value}} " </td>
                                    }
                                </tr>
                            </table>

                            <mat-paginator #paginator showFirstLastButtons [pageSizeOptions]="[10, 25, 50, 100]"
                                (page)="onPaginateTable()" aria-label="Select page of users"
                                [length]="paginator?.length" [pageIndex]="paginator?.pageIndex"
                                [pageSize]="paginator?.pageSize">
                            </mat-paginator>
                        </div>
                        <!--Dashboard List-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>