<div class="main-content">
	<div class="container-fluid">
		<div class="card">
			<div class="row card-header card-header-plain d-flex">
				<div class="card-desc d-flex flex-column justify-content-center">
					<h4 class="card-title">{{'DMP-LISTING.TITLE' | translate}} {{titlePrefix}}</h4>
					<div *ngIf="allVersions">
						<span class="all-versions">
							{{'DMP-LISTING.VIEW-ALL-VERSIONS' | translate}}
						</span>
						<span class="dmp-label">
							{{this.groupLabel}}
						</span>
					</div>
					<!-- <p class="card-category">{{'DMP-LISTING.SUBTITLE' | translate}}</p> -->
				</div>
				<div class="row ml-auto p-2">
					<!-- <button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="grantId ? ['/plans/new/grant/', grantId] : ['./new']"> -->
					<button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="['./new']">
						<mat-icon>add</mat-icon> {{'DMP-LISTING.ACTIONS.NEW' | translate}}
					</button>
					<button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="['/quick-wizard']">
						<mat-icon>play_circle_outline</mat-icon> {{'DMP-LISTING.ACTIONS.NEW-WITH-WIZARD' | translate}}
					</button>
				</div>
			</div>
			<div class="card-body table-responsive">
				<div class="listing row pb-2">
					<div class="col-12 col-sm-12 col-md-3">
						<app-dmp-criteria-component [showGrant]="showGrant" class="col-auto"></app-dmp-criteria-component>
					</div>
					<div class="col-12 col-sm-12 col-md-9 pt-4">
						<!-- <mat-paginator #paginator [length]="totalCount" [pageSizeOptions]="[10, 25, 100]" (page)="pageThisEvent($event)" class="top-paginator"></mat-paginator> -->
						<div *ngFor="let item of listingItems; let i = index">
							<app-dmp-listing-item-component [showDivider]="i != (listingItems.length - 1)" [dmp]="item"></app-dmp-listing-item-component>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-12 col-sm-12 col-md-9 ml-auto paginator">
						<mat-paginator #paginator [length]="totalCount" [pageSizeOptions]="[10, 25, 100]" (page)="pageThisEvent($event)" class="mt-2"></mat-paginator>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- <mat-table [dataSource]="dataSource" matSort (matSortChange)="refresh()">


							<ng-container cdkColumnDef="name">
								<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DMP-LISTING.COLUMNS.NAME' | translate}}
								</mat-header-cell>
								<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="grant">
								<mat-header-cell *matHeaderCellDef mat-sort-header="|join|grant:label">{{'DMP-LISTING.COLUMNS.GRANT' |
													translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row"> {{row.grant}} </mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="status">
								<mat-header-cell *matHeaderCellDef>{{'DMP-LISTING.COLUMNS.STATUS' | translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row"> {{enumUtils.toDmpStatusString(row.status)}} </mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="creationTime">
								<mat-header-cell *matHeaderCellDef mat-sort-header="created">
									{{'DMP-LISTING.COLUMNS.CREATION-TIME' | translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row"> {{row.creationTime | date:'shortDate'}} </mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="organisations">
								<mat-header-cell *matHeaderCellDef>{{'DMP-LISTING.COLUMNS.ORGANISATIONS' | translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row"> {{row.organisations}} </mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="version">
								<mat-header-cell *matHeaderCellDef mat-sort-header="version">
									{{'DMP-LISTING.COLUMNS.LATEST_VERSION' | translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row">
									{{row.version}}
								</mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="datasets">
								<mat-header-cell *matHeaderCellDef mat-sort-header="|count|dataset">
									{{'DMP-LISTING.COLUMNS.DATASETS' | translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
									<app-url-listing [items]="row.datasets" [urlLimit]="5" [parameters]="{ datasetLabel: row.label }">
									</app-url-listing>
								</mat-cell>
							</ng-container>

							<ng-container cdkColumnDef="actions">
								<mat-header-cell *matHeaderCellDef>{{'DMP-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
								<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
									<mat-menu #actionsMenu="matMenu">
										<button mat-menu-item (click)="openShareDialog(row.id,row.label)">
											<mat-icon>share</mat-icon>{{'DMP-LISTING.ACTIONS.INVITE' | translate}}
										</button>
										<button mat-menu-item (click)="addDataset(row.id)">
											<mat-icon>add</mat-icon>{{'DMP-LISTING.ACTIONS.ADD-DATASET' | translate}}
										</button>
										<button mat-menu-item (click)="showDatasets(row.id, row.label)">
											<mat-icon>list</mat-icon>{{'DMP-LISTING.ACTIONS.DATASETS' | translate}}
										</button>
										<button mat-menu-item (click)="viewVersions(row.groupId, row.label)">
											<mat-icon>library_books</mat-icon>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}
										</button>
									</mat-menu>
									<button mat-icon-button [matMenuTriggerFor]="actionsMenu">
										<mat-icon>more_vert</mat-icon>
									</button>
								</mat-cell>
							</ng-container>

							<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
							<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id);"></mat-row>

						</mat-table>
						<mat-paginator #paginator [length]="dataSource?.totalCount" [pageSizeOptions]="[10, 25, 100]">
						</mat-paginator> -->
