<div class="toggle-plugin-type">
  <p-selectButton [options]="pluginTypeOptions" [(ngModel)]="pluginType" (ngModelChange)="reloadPlugins()"></p-selectButton>
</div>

<div class="no-results" *ngIf="pagination.totalItems === 0">
  {{ getNoResultMessage() }}
</div>

<div class="plugins" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [autoInit]="true" [dataObservable]="onDataSubject.asObservable()">
  <div class="card plugin" *ngFor="let plugin of plugins">
    <div class="card-body">
      <div class="first-row">
        <span class="plugin-name">{{ plugin.name }}</span>

        <span class="plugin-version">{{ plugin.version }}</span>

        <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="plugin.homepage" i18n-title title="Plugin homepage (new window)">
          <my-global-icon iconName="home"></my-global-icon>
        </a>

        <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin homepage (new window)">
          <my-global-icon iconName="npm"></my-global-icon>
        </a>

        <div class="buttons">
          <my-edit-button *ngIf="pluginType !== PluginType.THEME" [routerLink]="getShowRouterLink(plugin)" label="Settings" i18n-label></my-edit-button>

          <my-button class="update-button" *ngIf="isUpdateAvailable(plugin)" (click)="update(plugin)" [loading]="isUpdating(plugin)"
                     [label]="getUpdateLabel(plugin)" icon="refresh" [attr.disabled]="isUpdating(plugin)"
          ></my-button>

          <my-delete-button (click)="uninstall(plugin)" label="Uninstall" i18n-label></my-delete-button>
        </div>
      </div>

      <div class="second-row">
        <div class="description">{{ plugin.description }}</div>
      </div>
    </div>
  </div>
</div>
