@if (missingKnowledgeDetails()[item().id]; as details) {
  <pa-table
    border
    [columns]="noScore() ? '1fr 80px' : 'repeat(2, 112px) 1fr 80px'">
    <pa-table-header>
      @if (!noScore()) {
        <pa-table-cell header>
          {{ 'metrics.remi.category-short.context_relevance' | translate }}
        </pa-table-cell>
        <pa-table-cell header>
          {{ 'metrics.remi.category-short.groundedness' | translate }}
        </pa-table-cell>
      }
      <pa-table-cell header>
        {{ 'kb.metrics.missing-knowledge.table.context-header' | translate }}
      </pa-table-cell>
      <pa-table-cell header></pa-table-cell>
    </pa-table-header>
    @for (context of details.context; track context) {
      <pa-table-row>
        @if (!noScore()) {
          <pa-table-cell center>
            {{ item().remi ? item().remi!.context_relevance[$index] * 20 + '%' : '–' }}
          </pa-table-cell>
          <pa-table-cell center>{{ item().remi ? item().remi!.groundedness[$index] * 20 + '%' : '–' }}</pa-table-cell>
        }
        <pa-table-cell><span [innerHTML]="context.text"></span></pa-table-cell>
        <pa-table-cell-menu>
          @if (context.text_block_id) {
            <pa-button
              aspect="basic"
              icon="eye"
              (click)="openViewer.emit(context.text_block_id)"></pa-button>
          }
        </pa-table-cell-menu>
      </pa-table-row>
    }
  </pa-table>
} @else if (missingKnowledgeError()[item().id]) {
  <nsi-info-card
    icon="warning"
    type="warning">
    {{ 'kb.metrics.error.context-loading-failed' | translate }}
  </nsi-info-card>
} @else {
  <nsi-spinner></nsi-spinner>
}
