<div class="admin-sub-header">
  <div i18n class="form-sub-title">Video abuses list</div>
</div>

<p-table
  [value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
  [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
>
  <ng-template pTemplate="header">
    <tr>
      <th i18n>Reason</th>
      <th i18n>Reporter</th>
      <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
      <th i18n>Video</th>
    </tr>
  </ng-template>

  <ng-template pTemplate="body" let-videoAbuse>
    <tr>
      <td>{{ videoAbuse.reason }}</td>
      <td>
        <a [href]="videoAbuse.reporterAccount.url" i18n-title title="Go to the account" target="_blank" rel="noopener noreferrer">
          {{ createByString(videoAbuse.reporterAccount) }}
        </a>
      </td>
      <td>{{ videoAbuse.createdAt }}</td>
      <td>
        <a [href]="videoAbuse.video.url" i18n-title title="Go to the video" target="_blank" rel="noopener noreferrer">
          {{ videoAbuse.video.name }}
        </a>
      </td>
    </tr>
  </ng-template>
</p-table>
