<div
  class="sm:absolute sm:inset-0 flex flex-col flex-auto min-w-0 sm:overflow-hidden bg-card dark:bg-transparent"
>
  <!-- Header -->
  <div
    class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-8 px-6 md:px-8 border-b"
  >
    <!-- Loader -->
    <div class="absolute inset-x-0 bottom-0" *ngIf="isLoading">
      <mat-progress-bar [mode]="'indeterminate'"></mat-progress-bar>
    </div>
    <!-- Title -->
    <div class="text-4xl font-extrabold tracking-tight">입금관리</div>
    <!-- Actions -->
    <div class="flex shrink-0 items-center mt-6 sm:mt-0 sm:ml-4">
      <!-- Search -->

      <button mat-icon-button (click)="__onClickSearch()">
        <mat-icon [svgIcon]="'heroicons_outline:search'"></mat-icon>
      </button>
    </div>
  </div>

  <!-- Memo -->
  <div
    class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-4 px-6 md:px-8 border-b"
  >
    <mat-form-field
      class="bet-mat-form-field-wrapper-mb-0 mr-2"
      style="width: 100%"
    >
      <textarea matInput cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
    </mat-form-field>
    <button mat-flat-button [color]="'primary'">메모저장</button>
  </div>

  <!-- Search -->
  <div
    *ngIf="__isSearchOpened"
    class="relative flex flex-col sm:flex-row flex-0 sm:items-center sm:justify-between py-4 px-6 md:px-8 border-b"
  >
    <!-- Actions -->
    <div fxLayout="row wrap" class="items-center mt-6 sm:mt-0 sm:ml-0">
      <!-- SelectBox -->
      <mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
        <mat-select placeholder="내용">
          <mat-option value="">카지노콤프</mat-option>
          <mat-option value="">슬롯콤프</mat-option>
          <mat-option value="">배팅콤프</mat-option>
          <mat-option value="">첫충콤프</mat-option>
        </mat-select>
      </mat-form-field>
      <mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
        <mat-select placeholder="아이디">
          <mat-option value="">아이디</mat-option>
          <mat-option value="">닉네임</mat-option>
          <mat-option value="">이름</mat-option>
          <mat-option value="">사이트</mat-option>
          <mat-option value="">파트너수동지급</mat-option>
        </mat-select>
      </mat-form-field>
      <!-- Search -->
      <mat-form-field
        fxFlex
        class="fuse-mat-rounded min-w-64 bet-mat-form-field-wrapper-mb-0 mr-2"
      >
        <mat-icon
          class="icon-size-5"
          matPrefix
          [svgIcon]="'heroicons_solid:search'"
        ></mat-icon>
        <input
          matInput
          [formControl]="searchInputControl"
          [autocomplete]="'off'"
          [placeholder]="'Search user'"
        />
      </mat-form-field>
      <!-- Add user button -->
      <button
        fxFlex
        mat-flat-button
        style="position: fixed; margin-top: 4px"
        [color]="'primary'"
        (click)="__createProduct()"
      >
        <mat-icon [svgIcon]="'heroicons_outline:search'"></mat-icon>
        <span class="ml-2 mr-1">Search</span>
      </button>
    </div>
  </div>
  <!-- Main -->
  <div class="flex flex-auto overflow-hidden">
    <div>
      <button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
        입금처리
      </button>
    </div>
    <div>
      <button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
        대기처리
      </button>
    </div>
    <!-- Products list -->
    <div
      class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
    >
      <ng-container *ngIf="deposits$ | async as deposits">
        <ng-container *ngIf="deposits.length > 0; else noDeposit">
          <div class="grid">
            <!-- Header -->
            <div
              class="deposit-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5"
            >
              <div>
                <mat-checkbox></mat-checkbox>
              </div>
              <div>상부</div>
              <div>
                아이디
                <hr style="margin: 7px 0px" />
                닉네임
              </div>
              <div>
                등급
                <hr style="margin: 7px 0px" />
                레벨
                <hr style="margin: 7px 0px" />
                상태
              </div>
              <div class="hidden sm:block">예금주</div>
              <div>정산종류</div>
              <div>비고</div>
              <div>입금예정금액</div>
              <div class="hidden md:block">
                등록날짜
                <hr style="margin: 7px 0px" />
                처리날짜
              </div>
              <div class="hidden md:block">입금출금</div>
              <div class="hidden md:block">게임중머니</div>
              <div class="hidden lg:block">카지노->캐쉬</div>
              <div class="hidden lg:block">회원정보</div>
              <div class="hidden lg:block">배팅정보</div>
              <div class="hidden lg:block">삭제</div>
            </div>
            <!-- Rows -->
            <ng-container *ngIf="deposits$ | async as deposits">
              <ng-container
                *ngFor="let deposit of deposits; trackBy: __trackByFn"
              >
                <div
                  class="deposit-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
                >
                  <div>
                    <mat-checkbox></mat-checkbox>
                  </div>
                  <div>{{ deposit.highRank }}</div>
                  <div>
                    {{ deposit.signinId }}
                    <hr style="margin: 7px 0px" />
                    {{ deposit.nickname }}
                  </div>
                  <div>
                    {{ deposit.rank }}
                    <hr style="margin: 7px 0px" />
                    LV{{ deposit.level }}
                    <hr style="margin: 7px 0px" />
                    {{ deposit.state }}
                  </div>
                  <div class="hidden sm:block">
                    {{ deposit.accountHolder }}
                  </div>
                  <div>{{ deposit.calculateType }}</div>
                  <div>{{ deposit.note }}</div>
                  <div>{{ deposit.depositAmount }}</div>
                  <div class="hidden md:block">
                    {{ deposit.registrationDate }}
                    <hr style="margin: 7px 0px" />
                    {{ deposit.processDate }}
                  </div>
                  <div class="hidden md:block">
                    입금{{ deposit.deposit }}
                    <hr style="margin: 7px 0px" />
                    출금{{ deposit.withdraw }}
                    <hr style="margin: 7px 0px" />
                    계{{ deposit.totalMoney }}
                  </div>
                  <div class="hidden md:block">
                    {{ deposit.gameMoney }}
                  </div>
                  <div class="hidden lg:block">
                    <button
                      mat-flat-button
                      class="bet-mat-small-8"
                      [color]="'primary'"
                    >
                      게임머니확인
                    </button>
                    <hr style="margin: 7px 0px" />
                    <button
                      mat-flat-button
                      class="bet-mat-small-8"
                      [color]="'primary'"
                    >
                      게임머니회수
                    </button>
                  </div>
                  <div class="hidden lg:block">
                    <button
                      mat-flat-button
                      class="bet-mat-small-8"
                      [color]="'primary'"
                    >
                      회원정보
                    </button>
                  </div>
                  <div class="hidden lg:block">
                    <button
                      mat-flat-button
                      class="bet-mat-small-8"
                      [color]="'primary'"
                    >
                      배팅정보
                    </button>
                  </div>
                  <div class="hidden lg:block">
                    <button
                      mat-flat-button
                      class="bet-mat-small-8"
                      [color]="'primary'"
                    >
                      취소
                    </button>
                  </div>
                </div>
              </ng-container>
            </ng-container>
          </div>

          <mat-paginator
            class="sm:absolute sm:inset-x-0 sm:bottom-0 border-b sm:border-t sm:border-b-0 z-10 bg-gray-50 dark:bg-transparent"
            [ngClass]="{ 'pointer-events-none': isLoading }"
            [length]="pagination?.length"
            [pageIndex]="pagination?.page"
            [pageSize]="pagination?.size"
            [pageSizeOptions]="[5, 10, 25, 100]"
            [showFirstLastButtons]="true"
          ></mat-paginator>
        </ng-container>
      </ng-container>

      <ng-template #noDeposit>
        <div
          class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
        >
          There are no data!
        </div>
      </ng-template>
    </div>
    <div>
      <button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
        입금처리
      </button>
    </div>
    <div>
      <button mat-flat-button class="bet-mat-small-8" [color]="'primary'">
        대기처리
      </button>
    </div>
  </div>
</div>
