<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 -->
      <div>
        <span>총회원수:<span style="color: red">38</span>명</span>&nbsp;&nbsp;
        <span>총 보유머니:<span style="color: red">21,437,873</span>원</span
        >&nbsp;&nbsp;
        <span>총 콤프:<span style="color: red">394,860</span>원</span
        >&nbsp;&nbsp;
        <span>총 합계:<span style="color: blue">21,832,733</span>원</span>
      </div>
    </div>
  </div>

  <div class="flex flex-auto overflow-hidden">
    <!-- Products list -->
    <div
      class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
    >
      <ng-container *ngIf="partners$ | async as partners">
        <ng-container *ngIf="partners.length > 0; else noPartner">
          <div class="grid">
            <!-- Header -->
            <div
              class="partner-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>관리</div>
              <div>요율</div>
              <div>매장수</div>
              <div>
                아이디
                <hr style="margin: 7px 0px" />
                닉네임
                <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 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 class="hidden lg:block">비고</div>
            </div>
            <!-- Rows -->
            <ng-container *ngIf="partners$ | async as partners">
              <ng-container
                *ngFor="let partner of partners; trackBy: __trackByFn"
              >
                <div
                  class="partner-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
                >
                  <div>관리</div>
                  <div>요율</div>
                  <div>
                    {{ partner.branchCount }}{{ partner.divisionCount
                    }}{{ partner.officeCount }}{{ partner.storeCount
                    }}{{ partner.memberCount }}
                  </div>
                  <div>
                    {{ partner.signinId }}
                    <hr style="margin: 7px 0px" />
                    {{ partner.nickname }}
                    <hr style="margin: 7px 0px" />
                    {{ partner.phoneNumber }}
                  </div>
                  <div>
                    {{ partner.rank }}
                    <hr style="margin: 7px 0px" />
                    LV{{ partner.level }}
                    <hr style="margin: 7px 0px" />
                    {{ partner.state }}
                  </div>
                  <div class="hidden sm:block">
                    {{ partner.accountHolder }}
                  </div>
                  <div class="hidden md:block">
                    {{ partner.calculateType }}
                  </div>
                  <div class="hidden md:block">
                    캐쉬{{ partner.ownCash }}
                    <hr style="margin: 7px 0px" />
                    콤프{{ partner.ownComp }}P
                    <hr style="margin: 7px 0px" />
                    쿠폰{{ partner.ownCoupon }}
                  </div>
                  <div class="hidden lg:block">
                    본인{{ partner.ownCharge }}
                    <hr style="margin: 7px 0px" />
                    하부{{ partner.bottomCharge }}
                  </div>
                  <div class="hidden lg:block">
                    본인{{ partner.ownExchange }}
                    <hr style="margin: 7px 0px" />
                    하부{{ partner.bottomExchange }}
                  </div>
                  <div class="hidden lg:block">
                    본인{{ partner.ownRevenue }}
                    <hr style="margin: 7px 0px" />
                    하부{{ partner.bottomRevenue }}
                  </div>
                  <div class="hidden lg:block">
                    {{ partner.registDate }}
                  </div>
                  <div class="hidden lg:block">
                    <button
                      mat-flat-button
                      class="bet-mat-small-8"
                      [color]="'primary'"
                      (click)="__onClickRegist($event)"
                    >
                      대본등록
                    </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 #noPartner>
        <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>
</div>
