<app-generic-header
  showBack="true"
  backLink="/home"
  [headerText]="'myTeam, myTeam-header' | translate">
</app-generic-header>


<ion-content>
  <div class="contentBg">
    <div class="result-graph">
      <div class="request-heading">
        <span>{{ts.trPK('myTeam','search-by')}}</span>
      </div>
      <div>
        <ion-row class="custom-radio">
          <!-- <ion-col [size]="3" class="search-dropdown" no-padding> -->
            <ion-radio-group [(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)" class="radio-list" style="display: flex;">
            
              <ion-item lines='none' style="--background: white" >
                <ion-radio mode="md" value="Name" [checked]="this.searchKeySelect === 'Name'" [color]="myColor" >{{ts.trPK('searchForReplacment','name')}}</ion-radio>
                <ion-label class="text-label" >{{ts.trPK('searchForReplacment','name')}}</ion-label>  
              </ion-item>
              
              <ion-item lines='none' style="--background: white" class="ion-no-padding">
                <ion-radio mode="md" value="User Name" [checked]="this.searchKeySelect === 'User Name'" [color]="myColor"  >{{ts.trPK('searchForReplacment','userName')}}</ion-radio>
                <ion-label class="text-label">{{ts.trPK('searchForReplacment','userName')}}</ion-label>  
              </ion-item>
              
              <ion-item lines='none' style="--background: white" class="ion-no-padding">
                <ion-radio mode="md" value="Email" [checked]="this.searchKeySelect === 'Email'" [color]="myColor"  >{{ts.trPK('searchForReplacment','email')}}</ion-radio>
                <ion-label class="text-label">{{ts.trPK('searchForReplacment','email')}}</ion-label>  
              </ion-item>
              
            </ion-radio-group>
        </ion-row>
        <!-- <ion-row>
          <ion-input placeholder="Search by" class="search-label"[(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)" ></ion-input>
       </ion-row> -->
       <ion-row>
       <ion-col  >
         <div (ionChange)="searchEmployee($event)" class="search-label">
        <ion-input *ngIf="showEmailInput" placeholder="Search by Email" [(ngModel)]="searchEmail"  pattern="email"  ></ion-input>
        <ion-input *ngIf="showUserNameOrNameInput" placeholder ="Search by Name" [(ngModel)]="searchNameOrUserName"  ></ion-input>
        <ion-input *ngIf="showUserNameInput" placeholder ="Search by Username" [(ngModel)]="searchUserName" ></ion-input>
         </div>
         <div *ngIf="isSearch" (click)="clearSearch()" [class]="direction =='en' ? 'search-container' : 'search-container-ar'">
            <ion-col style="float: right;"  >
                <ion-icon name="close" ></ion-icon>
            </ion-col>
        </div>
      </ion-col>
    </ion-row>
      </div>
     
  </div>
  <div class="div">
    <div class="text" >{{ts.trPK('myTeam','my-team-members')}}</div>
    <div [ngClass]="direction == 'en' ? 'numberEmp':'numberEmp-ar' ">{{EmployeeTotal}}</div>
  </div>
  
    <ng-container *ngFor="let subordinate of empSubordinate;let i=index">
        <app-employee-information
          [name]="subordinate.EMPLOYEE_NAME"
          [title]="subordinate.POSITION_NAME"
          [employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
          [employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
          (onGetDetails)="getDetails(i)">
        </app-employee-information>
    </ng-container>

  </div>

   <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
    <ion-infinite-scroll-content></ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content> 



 
 