<div class="pagination">
  <div class="count" *ngIf="data?.total">
    Показаны {{shownFrom}}–{{shownTo}} из {{data?.total}}
  </div>
  <button type="button" *ngIf="data?.currentPage > 3" (click)="setPage(1)">1</button>
  <div class="dots" *ngIf="data?.currentPage > 4"></div>
  <button type="button" [class.active]="page === currentPage" (click)="setPage(page)" *ngFor="let page of pages">{{page}}</button>
  <div class="dots" *ngIf="currentPage < data?.totalPages && data?.currentPage + 3 < data?.totalPages"></div>
  <button type="button" *ngIf="data?.currentPage + 2 < data?.totalPages" (click)="setPage(data?.totalPages)">{{data?.totalPages}}</button>
  <button type="button" class="next" (click)="nextPage()" *ngIf="currentPage < data?.totalPages">Далее</button>  
</div>
