<!--inja  ye use name bezzar ke set bashe khoshgel beshe-->
<div class="session mat-indigo" dir="rtl">
  <div class="session-content">
    <div class="session-wrapper">
      <mat-card>
        <mat-card-content>
          <form [formGroup]="form" (ngSubmit)="onSubmit()">
            <div fxLayout="column" fxLayoutAlign="space-around">
              <!--میخوام این ست بشه -->
              <div class="pb-1">
                <mat-form-field style="width: 100%">
                  <input matInput placeholder="ایمیل" type="text" [(ngModel)]="emailCtrl" formControlName="email">
                </mat-form-field>
              </div>
              <div class="pb-1">
                <mat-form-field style="width: 100%">
                  <input matInput placeholder="لطفا کد خود را وارد کنید " type="text" formControlName="smstoken">
                </mat-form-field>
                <div [hidden]="smstoken.valid || smstoken.untouched">
                  <div [hidden]="smstoken.valid">
                    {{smstoken.getError("error") ? smstoken.getError("error") : 'لطفا کد خود را وارد کنید '}}
                  </div>
                </div>
              </div>
              <button mat-raised-button color="primary" type="submit" [disabled]="!form.valid">ارسال</button>
            </div>
            <div *ngIf="timer ; then timeleft  ; else receiveCode"></div>
            <ng-template #timeleft>
              <p>00:{{timeLeft}}</p>
            </ng-template>
            <ng-template #receiveCode>
              <button mat-button color="primary" type="button"  (click)="receiveData()">دریافت
                مجدد کد
              </button>
            </ng-template>

          </form>
        </mat-card-content>
      </mat-card>
    </div>
  </div>
</div>

