<div *ngIf="showHeaderInfo" class="tw-mt-6 tw-mb-2 tw-pb-2.5">
  <div class="tw-flex tw-items-center tw-gap-2 tw-mb-5">
    <h1 class="tw-m-0">{{ "devices" | i18n }}</h1>

    <button
      type="button"
      class="tw-border-none tw-bg-transparent tw-text-primary-600 tw-flex tw-items-center tw-size-4"
      [bitPopoverTriggerFor]="infoPopover"
      position="right-start"
    >
      <bit-icon name="bwi-question-circle"></bit-icon>
    </button>

    <bit-popover [title]="'whatIsADevice' | i18n" #infoPopover>
      <p class="tw-mb-0">{{ "aDeviceIs" | i18n }}</p>
    </bit-popover>
  </div>

  <p>
    {{ "deviceListDescriptionTemp" | i18n }}
  </p>
</div>

@if (initializing) {
  <div class="tw-flex tw-justify-center tw-items-center tw-p-4">
    <bit-icon
      name="bwi-spinner"
      class="bwi-spin tw-text-2xl"
      [ariaLabel]="'loading' | i18n"
    ></bit-icon>
  </div>
} @else {
  <!-- Table View: displays on medium to large screens -->
  <!-- TODO: PM-34091 - Remove the [showRecentlyActive] binding once the input is deleted from the table component. -->
  <auth-device-management-table
    ngClass="tw-hidden md:tw-block"
    [devices]="devices"
    [showRecentlyActive]="showRecentlyActive"
    (onAuthRequestAnswered)="handleAuthRequestAnswered($event)"
  ></auth-device-management-table>

  <!-- List View: displays on small screens -->
  <!-- TODO: PM-34091 - Remove the [showRecentlyActive] binding once the input is deleted from the item group component. -->
  <auth-device-management-item-group
    ngClass="md:tw-hidden"
    [devices]="devices"
    [showRecentlyActive]="showRecentlyActive"
    (onAuthRequestAnswered)="handleAuthRequestAnswered($event)"
  ></auth-device-management-item-group>
}
