<div class="main-content">
	<div class="container-fluid">
		<div *ngIf="dmp" class="card">
			<div class="card-header card-header-plain d-flex">
				<div class="card-desc clone-dmp d-flex flex-column justify-content-center">
					<h4 class="card-title">{{ formGroup.get('label').value }}</h4>
				</div>
				<div class="d-flex ml-auto p-2">
					<span *ngIf="!isNewVersion" class="clone-mode">{{ 'DMP-LISTING.ACTIONS.CLONE' | translate}} &nbsp;</span>
					<span *ngIf="isNewVersion" class="clone-mode">{{ 'DMP-LISTING.ACTIONS.NEW-VERSION' | translate}} &nbsp;</span>
					<span class="clone-mode-text"> {{ 'GENERAL.PREPOSITIONS.OF' | translate}} {{ parentDmpLabel }}</span>
				</div>
			</div>
			<form *ngIf="formGroup" (ngSubmit)="formSubmit()">
				<div class="d-flex flex-column">
					<mat-tab-group [(selectedIndex)]="selectedTab" class="mt-3">
						<mat-tab>
							<ng-template mat-tab-label>
								<i class="material-icons-outlined mr-2">view_agenda</i>
								{{ 'SIDE-BAR.GENERAL' | translate }}
							</ng-template>
							<app-general-tab [formGroup]="formGroup" [isNewVersion]="isNewVersion" [isClone]="isClone"></app-general-tab>
						</mat-tab>
						<mat-tab>
							<ng-template mat-tab-label>
								<mat-icon class="mr-2">work_outline</mat-icon>
								{{ 'DMP-LISTING.COLUMNS.GRANT' | translate }}
							</ng-template>
							<app-grant-tab [grantformGroup]="formGroup.get('grant')" [projectFormGroup]="formGroup.get('project')" [funderFormGroup]="formGroup.get('funder')" [isFinalized]="isFinalized" [isNewVersion]="isNewVersion" [isClone]="isClone" [isNew]="isNew"></app-grant-tab>
						</mat-tab>
						<mat-tab>
							<ng-template mat-tab-label>
								<mat-icon class="mr-2">library_books</mat-icon>
								{{ 'DMP-LISTING.COLUMNS.DATASETS' | translate }}
							</ng-template>
							<app-dmp-wizard-dataset-listing-component *ngIf="formGroup" [formGroup]="formGroup" [dmpId]="formGroup.get('id').value"></app-dmp-wizard-dataset-listing-component>
						</mat-tab>
						<mat-tab disabled>
							<ng-template mat-tab-label></ng-template>
						</mat-tab>
					</mat-tab-group>

					<div class="d-flex justify-content-end pt-2 pb-4 pl-2 pr-2">
						<div>
							<button mat-raised-button color="primary" (click)="cancel(dmp.id)" type="button" class="text-uppercase mr-2">
								{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}
							</button>
						</div>
						<div *ngIf="formGroup.enabled">
							<button mat-raised-button type="button" (click)="formSubmit()" [disabled]="!isFormValid()" class="text-uppercase dark-theme mr-2" color="primary">
								{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}
							</button>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
