<div *ngFor="let entry of healthInfoComponent | dsObjNgFor" data-test="collapse">
  <div *ngIf="entry && !isPlainProperty(entry.value)" class="mb-3 border-bottom">
    <div class="w-100 d-flex gap-3 justify-content-between collapse-toggle" (click)="collapse.toggle()">
      <button type="button" class="btn btn-link p-0" (click)="$event.preventDefault()" [attr.aria-expanded]="!collapse.collapsed"
              [attr.aria-controls]="'health-info-component-' + entry.key + '-content'">
        {{ entry.key | titlecase }}
      </button>
      <div class="d-flex my-auto">
        <span *ngIf="collapse.collapsed" class="fas fa-chevron-down"></span>
        <span *ngIf="!collapse.collapsed" class="fas fa-chevron-up"></span>
      </div>
    </div>
    <div #collapse="ngbCollapse" [id]="'health-info-component-' + entry.key + '-content'" [ngbCollapse]="isCollapsed">
      <div class="card border-0">
        <div class="card-body">
          <ds-health-info-component [healthInfoComponent]="entry.value"
                                    [healthInfoComponentName]="entry.key"
                                    [isNested]="true"
                                    data-test="info-component"></ds-health-info-component>
        </div>
      </div>
    </div>
  </div>
  <ng-container *ngIf="entry && isPlainProperty(entry.value)">
    <p data-test="property"> <span class="font-weight-bold">{{ getPropertyLabel(entry.key) | titlecase }}</span> : {{entry.value}}</p>
  </ng-container>
</div>
