<div class="wrapper">
  <div class="content">
    <div>
      <button class="button float-right mr-1" [routerLink]="['/groups/', id]"><i class="fas fa-arrow-left"></i> Powrót</button>
      <div style="clear: both;"></div>
    </div>
    <h1>Wyniki za testy w grupie: {{group?.name}}</h1>
    <br />
    <div>
      <h2>Wybierz test aby zobaczyć wyniki:</h2>
      <br />
      <ag-grid-angular style="width: 100%; height: 475px;" class="ag-theme-dark" [rowData]="data" [columnDefs]="columnDefs"
        [enableSorting]="true" [enableFilter]="true" (gridReady)="onGridReady($event)" [gridOptions]="gridOptions"
        [pagination]="true" [paginationAutoPageSize]="true" [localeText]="localeText" (gridColumnsChanged)="onGridColumnsChanged($event)"
        (rowClicked)="onRowClicked($event)" (gridSizeChanged)="onGridSizeChanged($event)">
      </ag-grid-angular>
    </div>
    <br /><br />
    <div *ngIf="selectedTest">
      <h2>Wybrany test: {{selectedTest.title}}</h2>
      <br />
      <button *ngIf="group" class="button float-right mr-1" (click)="downloadCSVResults()">Eksportuj wyniki do pliku CSV</button>
      <div style="clear: both;"></div>
      <br />
      <ag-grid-angular style="width: 100%; height: 475px;" class="ag-theme-dark" [rowData]="testdata" [columnDefs]="testcolumnDefs"
        [enableSorting]="true" [enableFilter]="true" (gridReady)="testonGridReady($event)" [gridOptions]="testgridOptions"
        [pagination]="true" [paginationAutoPageSize]="true" [localeText]="localeText" (gridColumnsChanged)="testonGridColumnsChanged($event)"
        (rowClicked)="testonRowClicked($event)" (gridSizeChanged)="testonGridSizeChanged($event)">
      </ag-grid-angular>
    </div>
  </div>
</div>
