<form *ngIf="formGroup" [formGroup]="formGroup">
	<h1 mat-dialog-title>{{'ADDRESEARCHERS-EDITOR.TITLE' | translate}}</h1>
	<div mat-dialog-content class="row pb-2">
		<mat-form-field class="col-12">
			<input matInput formControlName="reference" [placeholder]="'DMP-EDITOR.MAIN-INFO.UNIQUE-IDENTIFIER' | translate" required>
			<i matSuffix class="fa fa-spinner fa-spin" *ngIf="formGroup.get('reference').pending && !referenceExists"></i>
			<mat-error *ngIf="formGroup.get('reference').hasError('researcherIdentifierExists')">{{'DMP-EDITOR.MAIN-INFO.RESEARCHER-IDENTIFIER-EXISTS' | translate}}</mat-error>
			<mat-icon *ngIf="!formGroup.get('reference').pending && formGroup.get('reference').dirty && formGroup.get('reference').valid && !referenceExists" class="text-success" matSuffix>check</mat-icon>
			<mat-icon *ngIf="!formGroup.get('reference').pending && formGroup.get('reference').dirty && formGroup.get('reference').invalid || referenceExists" class="text-danger" matSuffix>clear</mat-icon>
			<small *ngIf="referenceExists" class="text-danger">{{'DMP-EDITOR.MAIN-INFO.IDENTIFIER-EXISTS-RESEARCHER-LIST' | translate}}</small>
		</mat-form-field>
		<mat-form-field class="col-12">
			<input matInput formControlName="firstName" placeholder="{{'ADDRESEARCHERS-EDITOR.FIRST_NAME' | translate}}" required>
			<mat-error *ngIf="formGroup.get('firstName').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
		</mat-form-field>
		<mat-form-field class="col-12">
			<input matInput formControlName="lastName" placeholder="{{'ADDRESEARCHERS-EDITOR.LAST_NAME' | translate}}" required>
			<mat-error *ngIf="formGroup.get('lastName').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
		</mat-form-field>
		<div class="col-12">
			<div class="row">
				<div class="ml-auto col-auto"><button mat-raised-button mat-dialog-close type="button">{{'DMP-EDITOR.MAIN-INFO.CANCEL' | translate}}</button></div>
				<div class="col-auto"><button mat-raised-button [disabled]="!isFormValid()" color="primary" (click)="addResearcher()" type="button">{{'DMP-EDITOR.MAIN-INFO.SAVE' | translate}}</button></div>
			</div>
		</div>
	</div>
</form>
