<section class="attendance-company">
  <main fxLayout="row" fxLayoutAlign="start center" class="gap-20">
    <h1 fxLayout="row" fxLayoutAlign="start center" class="gap-10 bold">
      <img src="assets/images/attendance-icon.svg" alt="" title="" />
      <span>Attendance</span>
    </h1>
    <p class="bold">Saturday 15/10/2023</p>
  </main>
  <div class="attendance-company__search">
    <!-- <img
      src="../../../../assets/images/avatar.png"
      alt=""
      title=""
    /> -->
    <input type="search" placeholder="Search..." />
  </div>

  <table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
    <!--- Note that these columns can be defined in any order.
        The actual rendered columns are set as a property on the row definition" -->

    <ng-container matColumnDef="user">
      <th mat-header-cell *matHeaderCellDef>User</th>
      <td mat-cell *matCellDef="let element">
        <div fxLayout="row" fxLayoutAlign="start center" class="gap-10 ptb-10">
          <img [src]="element.user.img" alt="" title="" />
          <div>
            <span class="span bold">{{ element.user.name }}</span>
            <span class="span gray">{{ element.user.position }}</span>
            <span class="span gray">{{ element.user.email }}</span>
          </div>
        </div>
      </td>
    </ng-container>

    <ng-container matColumnDef="department">
      <th mat-header-cell *matHeaderCellDef>Department</th>
      <td mat-cell *matCellDef="let element">{{ element.department }}</td>
    </ng-container>

    <!-- Name Column -->
    <ng-container matColumnDef="date">
      <th mat-header-cell *matHeaderCellDef>Date</th>
      <td mat-cell *matCellDef="let element">{{ element.date }}</td>
    </ng-container>

    <!-- Weight Column -->
    <ng-container matColumnDef="checkin">
      <th mat-header-cell *matHeaderCellDef>Check In</th>
      <td mat-cell *matCellDef="let element">{{ element.checkin }}</td>
    </ng-container>

    <!-- Symbol Column -->
    <ng-container matColumnDef="checkout">
      <th mat-header-cell *matHeaderCellDef>Check Out</th>
      <td mat-cell *matCellDef="let element">{{ element.checkout }}</td>
    </ng-container>

    <!-- Symbol Column -->
    <ng-container matColumnDef="status">
      <th mat-header-cell *matHeaderCellDef>Status</th>
      <td mat-cell *matCellDef="let element">
        <span
          [ngClass]="{
            online: element.status === 'Online',
            offline: element.status === 'Offline'
          }"
          >{{ element.status }}</span
        >
      </td>
    </ng-container>

    <ng-container matColumnDef="actions">
      <th mat-header-cell *matHeaderCellDef></th>
      <td mat-cell *matCellDef="let element">
        <button class="details" [routerLink]="['./attendance-details']">
          View Details
        </button>
      </td>
    </ng-container>

    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
  </table>
  <app-pagenation></app-pagenation>
</section>
