<div id="layout-wrapper">
  <div class="inner-pg-sp">
    <div class="container-fluid">
      <div class="row">
        <div class="col-12">
          <div class="d-sm-flex align-items-center justify-content-between navbar-header p-0">
       
          </div>
        </div>
      </div>
      <div class="container-fluid">
                <div class="col-xl-12 mt-4">
                    <div class="card border">
                        <div class="card-body">
                            <div class="table-section">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="card-body mt-2 p-0">
                                            <div class="card mb-0 mt-2">
                                                <div
                                                    class="card-header font-edit-13-child d-flex justify-content-between align-items-center">
                                                    {{'setupUser' | translate}}
                                                </div>
                                                <div class="card-body">
                                                    <form>
                                                         <div class="row g-3 mb-3">
                                                            <div class="col-md-6">
                                                                <div class="d-flex align-items-center gap-2">
                                                                    <label for="userId" class="text-nowrap">
                                                                        {{ 'userId' | translate }}<span
                                                                            class="mandatory">*</span>
                                                                    </label>
                                                                    <div class="password-wrapper position-relative w-100">
                                                                        <div class="d-flex flex-row align-items-stretch">
                                                                        <input type="text" id="userId"
                                                                            class="form-control"
                                                                            [(ngModel)]="userId"
                                                                            name="userId"
                                                                            placeholder="{{ 'userID' | translate }}" appNoWhitespaces
                                                                            />
                                                                            
                                                                       </div>
                                                                        <!-- <div class="text-danger">
                                                                            {{ 'requiredField' | translate }}
                                                                        </div> -->
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-6">
                                                                <div class="d-flex align-items-start gap-2">
                                                                    <label for="name"
                                                                        class="text-nowrap mt-2">
                                                                        {{ 'name' | translate }}<span
                                                                            class="mandatory">*</span>
                                                                    </label>
                                                                    <div class="password-wrapper position-relative w-100">
                                                                        
                                                                            <input id="userFullname"
                                                                            class="form-control"
                                                                            [(ngModel)]="userFullname"
                                                                            name="userFullname"
                                                                            maxlength="500"
                                                                            placeholder="{{ 'userName' | translate }}" appNoWhitespaces
                                                                            rows="3"  />
                                                                          
                                                                       
                                                                        
                                                                    </div>
                                                                </div>
                                                            </div>

                                                        </div>
                                                         <div class="row g-3 mb-3">
                                                             <div class="col-md-6">
                                                                <div class="d-flex align-items-center gap-2">
                                                                    <label for="defaultPassword" class="text-nowrap">
                                                                        {{ 'defaultPassword' | translate }}<span
                                                                            class="mandatory">*</span>
                                                                    </label>
                                                                    <div class="password-wrapper position-relative w-100">
                                                                       <input id="defaultPassword"
                                                                            class="form-control"
                                                                            [(ngModel)]="defaultPassword"   
                                                                            name="defaultPassword"                                                     
                                                                            placeholder="{{ 'passwordPlaceHolder' | translate }}" appNoWhitespaces/>
                                                                            
                                                                        <!-- <div class="text-danger">
                                                                             <div>
                                                                                    {{ 'requiredField' | translate }}
                                                                                </div>
                                                                        </div>
                                                                        <div>
                                                                            {{ 'expiryBeforeRenewal' | translate }}
                                                                        </div> -->
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-6">
                                                                
                                                            </div>
                                                        </div>
                                                         <div class="row g-3 mb-3">
                                                            <div class="col-md-6 ms-auto text-end">
                                                            <button type="button" class="btn btn-primary waves-effect waves-light" (click)="onSubmit()"
                                                              [hidden]="mode === 'view' && showForm">
                                                              {{ 'save' | translate }}
                                                            </button>
                                                             
                                                               
                                                            </div>
                                                        </div>

                                                      
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
      <div class="container-fluid">
        <div class="col-xl-12 mt-4">
          <div class="card border">
            <div class="card-body">
              <div class="table-section">
                <div class="row">
                  <div class="col-lg-12">
                    <div class="card-body mt-2 p-0">
                      <div class="card mb-0 mt-2">
                        <div class="card-header font-edit-13-child d-flex justify-content-between align-items-center">
                        {{'SetupUserDetails' | translate}}
                          <div class="d-flex align-items-center gap-2">
                            <div class="search-box">
                              <input type="text" class="form-control form-control-sm" 
                                [(ngModel)]="searchText"
                                (ngModelChange)="onSearch(searchText)"
                                placeholder="{{ 'search' | translate }}">
                              <i class="fas fa-search search-icon"></i>
                            </div>
                            <i class="materialdesignicons">
                              <ng-container *ngIf="renewalDataExpanded; else collapsedIcon">
                                <i class="dripicons-chevron-up float-end"></i>
                              </ng-container>
                              <ng-template #collapsedIcon>
                                <i class="dripicons-chevron-down float-end"></i>
                              </ng-template>
                            </i>
                          </div>
                        </div>
                        <div class="card-body">
                          <div class="table-responsive">
                            <table class="table mb-0 border">
                              <thead class="table-light">
                                <tr>
                                  <th style="width: 40%">{{'userID' | translate}}</th>
                                  <th style="width: 40%">{{'Name' | translate}}</th>                             
                                  <th style="width: 20%">{{'action' | translate}}</th> 
                                </tr>
                              </thead>
                              <tbody>
                                <tr *ngFor="let item of allItems">
                                  <td>{{ item.userId }}</td>
                                  <td>{{ item.userFullname }}</td>

                              
                                  <td>
                                    <div class="d-flex justify-content-center gap-2">
                              
                                      <button class="btn btn-info btn-sm" title="View" (click)="onView(item.userId)">
                                        <i class="mdi mdi-eye-outline"></i>
                                      </button>
                              
                                      <button class="btn btn-danger btn-sm" title="Delete" (click)="onDelete(item.userId)">
                                        <i class="fas fa-trash-alt"></i>
                                      </button>
                                    </div>
                                  </td>
                                </tr>
                              </tbody>
                            </table>
                            <div class="d-flex justify-content-between align-items-center mt-3">
  <div class="form-group mb-0">
    <ng-select class="form-select-sm"
        [items]="pageSizeOptions"
        bindLabel="label"
        bindValue="value"
        [(ngModel)]="itemsPerPage"
        (change)="onPageSizeChange(itemsPerPage)"
        [searchable]="false"
        [clearable]="false"
        [dropdownPosition]="'top'">
    </ng-select>
  </div>

  <div class="text-muted">
      {{ 'page' | translate }} {{ currentPage }} {{ 'of' | translate }} {{ getTotalPages() }} ({{ totalCount }} {{ 'totalItems' | translate }})
  </div>

  <div class="btn-group">
    <button class="btn btn-primary waves-effect waves-light" (click)="previousPage()">
      {{ 'previous' | translate }}
    </button>
    <button class="btn btn-primary waves-effect waves-light" (click)="nextPage()">
      {{ 'next' | translate }}
    </button>
  </div>
</div>

                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>