<div class="main">
  <div class="card">
    <div class="flex flex-row justify-between">
      <h1 class="title">รายการรายวิชา</h1>
      <div>
        <button class="add-button mr-1" (click)="onExcel()">Excel</button>
<!--        <button mat-icon-button [matMenuTriggerFor]="menu">-->
<!--          <mat-icon>more_vert</mat-icon>-->
<!--        </button>-->
        <mat-menu #menu="matMenu">
          <button mat-menu-item>
            <mat-icon>dialpad</mat-icon>
            <span>Redial</span>
          </button>
          <button mat-menu-item disabled>
            <mat-icon>voicemail</mat-icon>
            <span>Check voice mail</span>
          </button>
          <button mat-menu-item>
            <mat-icon>notifications_off</mat-icon>
            <span>Disable alerts</span>
          </button>
        </mat-menu>
      </div>
    </div>
    <div class="overflow-x-auto">
      <table mat-table [dataSource]="subjectList">
        <ng-container matColumnDef="1">
          <th mat-header-cell *matHeaderCellDef> ลำดับ </th>
          <td mat-cell *matCellDef="let x; let i = index"> {{i+1}} </td>
        </ng-container>
        <ng-container matColumnDef="2">
          <th mat-header-cell *matHeaderCellDef> รหัสวิชา </th>
          <td mat-cell *matCellDef="let x"> {{x.subject_code}} </td>
        </ng-container>
        <ng-container matColumnDef="3">
          <th mat-header-cell *matHeaderCellDef> ชื่อวิชา </th>
          <td mat-cell *matCellDef="let x"> {{x.subject_name_th}} </td>
        </ng-container>
        <tr mat-header-row *matHeaderRowDef="column"></tr>
        <tr mat-row *matRowDef="let row; columns: column;"></tr>
      </table>
      <mat-paginator
        [pageSize]="100"
        [pageSizeOptions]="[5, 10, 25  , 100]" showFirstLastButtons></mat-paginator>
    </div>
  </div>
</div>
