import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { DatasetListingModel } from '../../../../core/model/dataset/dataset-listing';
import { Router } from '@angular/router';
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';

@Component({
	selector: 'app-dataset-listing-item-component',
	templateUrl: './dataset-listing-item.component.html',
	styleUrls: ['./dataset-listing-item.component.scss']
})
export class DatasetListingItemComponent implements OnInit {

	@Input() dataset: DatasetListingModel;
	@Input() showDivider: boolean = true;
	@Output() onClick: EventEmitter<DatasetListingModel> = new EventEmitter();

	isDraft: boolean;

	constructor(private router: Router) { }

	ngOnInit() {
		if (this.dataset.status == DatasetStatus.Draft) { this.isDraft = true }
		else { this.isDraft = false }
	}


	// grantClicked(dataset: DatasetListingModel) {
	// 	this.router.navigate(['/grants/edit/' + dataset.grantId]);
	// }

	// itemClicked() {
	// 	this.onClick.emit(this.dataset);
	// }

	// datasetClicked(dataset: DatasetListingModel) {
	// 	this.router.navigate(['/plans/edit/' + dataset.dmpId])
	// }

}
