<div *ngVar="(contentSource$ |async) as contentSource">
    <div class="container-fluid space-children-mr" *ngIf="shouldShow">
        <h3>{{ 'collection.source.controls.head' | translate }}</h3>
        <div>
            <span class="font-weight-bold">{{'collection.source.controls.harvest.status' | translate}}</span>
            <span>{{contentSource?.harvestStatus}}</span>
        </div>
        <div>
            <span class="font-weight-bold">{{'collection.source.controls.harvest.start' | translate}}</span>
            <span>{{contentSource?.harvestStartTime ? contentSource?.harvestStartTime : 'collection.source.controls.harvest.no-information'|translate }}</span>
        </div>
        <div>
            <span class="font-weight-bold">{{'collection.source.controls.harvest.last' | translate}}</span>
            <span>{{contentSource?.lastHarvested ? contentSource?.lastHarvested : 'collection.source.controls.harvest.no-information'|translate }}</span>
        </div>
        <div>
            <span class="font-weight-bold">{{'collection.source.controls.harvest.message' | translate}}</span>
            <span>{{contentSource?.message ? contentSource?.message: 'collection.source.controls.harvest.no-information'|translate }}</span>
        </div>

        <button *ngIf="!(testConfigRunning$ |async)" class="btn btn-secondary"
                [dsBtnDisabled]="!(isEnabled)"
                (click)="testConfiguration(contentSource)">
            <span>{{'collection.source.controls.test.submit' | translate}}</span>
        </button>
        <button *ngIf="(testConfigRunning$ |async)" class="btn btn-secondary"
                [dsBtnDisabled]="true">
            <span class="spinner-border spinner-border-sm spinner-button" role="status" aria-hidden="true"></span>
            <span>{{'collection.source.controls.test.running' | translate}}</span>
        </button>
        <button *ngIf="!(importRunning$ |async)" class="btn btn-primary"
                [dsBtnDisabled]="!(isEnabled)"
                (click)="importNow()">
            <span class="d-none d-sm-inline">{{'collection.source.controls.import.submit' | translate}}</span>
        </button>
        <button *ngIf="(importRunning$ |async)" class="btn btn-primary"
                [dsBtnDisabled]="true">
            <span class="spinner-border spinner-border-sm spinner-button" role="status" aria-hidden="true"></span>
            <span class="d-none d-sm-inline">{{'collection.source.controls.import.running' | translate}}</span>
        </button>
        <button *ngIf="!(reImportRunning$ |async)" class="btn btn-primary"
                [dsBtnDisabled]="!(isEnabled)"
                (click)="resetAndReimport()">
            <span class="d-none d-sm-inline">&nbsp;{{'collection.source.controls.reset.submit' | translate}}</span>
        </button>
        <button *ngIf="(reImportRunning$ |async)" class="btn btn-primary"
                [dsBtnDisabled]="true">
            <span class="spinner-border spinner-border-sm spinner-button" role="status" aria-hidden="true"></span>
            <span class="d-none d-sm-inline">&nbsp;{{'collection.source.controls.reset.running' | translate}}</span>
        </button>


    </div>
</div>
