<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>

  <!-- 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="40">40</mat-option>
          <mat-option value="60">60</mat-option>
          <mat-option value="80">80</mat-option>
          <mat-option value="100">100</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="level1">LV.1</mat-option>
          <mat-option value="level2">LV.2</mat-option>
          <mat-option value="level3">LV.3</mat-option>
          <mat-option value="level4">LV.4</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-option value="">정지</mat-option>
        </mat-select>
      </mat-form-field>
      <!-- Search 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">
    <!-- Products list -->
    <div
      class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
    >
      <ng-container *ngIf="customers$ | async as customers">
        <ng-container *ngIf="customers.length > 0; else noUser">
          <div class="grid">
            <!-- Header -->
            <div
              class="customer-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8shadow 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" />
                작성일
                <hr style="margin: 7px 0px" />
                조회수
              </div>

              <div>
                작성자
                <hr style="margin: 7px 0px" />
                등급
                <hr style="margin: 7px 0px" />
                상위
              </div>
              <div class="hidden md:block">메모</div>
              <div class="hidden md:block">최근충전</div>
              <div class="hidden md:block">최근로그인</div>
              <div class="hidden md:block">사이트</div>
              <div>
                답변
                <hr style="margin: 7px 0px" />
                상태
                <hr style="margin: 7px 0px" />
                로그인
              </div>
            </div>
            <!-- Rows -->
            <ng-container *ngIf="customers$ | async as customers">
              <ng-container
                *ngFor="let customer of customers; trackBy: __trackByFn"
              >
                <div
                  class="customer-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
                >
                  <div class="hidden sm:block truncate">
                    <mat-checkbox></mat-checkbox>
                  </div>
                  <!-- 일련번호 -->
                  <div class="hidden sm:block truncate">
                    {{ customer.idx }}
                  </div>
                  <!-- 제목 -->
                  <div class="hidden sm:block truncate">
                    {{ customer.title }}
                    <hr style="margin: 7px 0px" />

                    <!-- 작성일 -->

                    {{ customer.writeDate }}
                    <!-- 조회수 -->
                    <hr style="margin: 7px 0px" />
                    {{ customer.views }}
                  </div>
                  <!-- 작성자 (닉네임)-->
                  <!-- id -->
                  <div class="hidden sm:block truncate">
                    {{ customer.signinId }}
                    <hr style="margin: 7px 0px" />
                    <!-- 등급 -->
                    {{ customer.level }}
                    <!-- 상위 -->
                    <hr style="margin: 7px 0px" />
                    {{ customer.highRank }}
                  </div>

                  <!-- 메모 -->
                  <div class="hidden sm:block truncate">
                    {{ customer.memo }}
                  </div>
                  <!-- 최근충전 -->
                  <div class="hidden sm:block truncate">
                    {{ customer.finalOwnCharge }}
                  </div>
                  <!-- 최근로그인 -->
                  <div class="hidden sm:block truncate">
                    {{ customer.finalSigninDate }}
                  </div>

                  <!-- 사이트 -->
                  <div class="hidden sm:block truncate">
                    {{ customer.site }}
                  </div>

                  <div class="hidden sm:block truncate">
                    <!-- 답변 -->
                    {{ customer.answer }}
                    <hr style="margin: 7px 0px" />
                    <!-- 상태 -->
                    {{ customer.state }}
                    <hr style="margin: 7px 0px" />
                    <!-- 로그인 -->
                    <button mat-flat-button [color]="'primary'">
                      중복로그인
                    </button>
                  </div>

                  <!-- management -->
                </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 #noUser>
        <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>
