import { Component, OnInit, Input } from '@angular/core';
import { Review } from '../review.model';
import { Reviews } from '../../../ecm-model/product-review.model';

@Component( {
    selector: 'review-screen',
    templateUrl: './review-screen.component.html',
    styleUrls: ['./review-screen.component.css']
})
export class ReviewScreenComponent implements OnInit {

    @Input() editMode: string = 'V';
//    @Input() reviewList: Review;
    @Input( 'userReview' ) userReview: Reviews;
    @Input( 'isNullReview' ) isNullReview: boolean;

    constructor() { }

    ngOnInit() {
        console.log('userReview:',this.userReview,this.isNullReview);
    }

    updateRate( updatedRate ) {
        console.log( 'Updated Rate: ' + updatedRate );
        this.userReview.productRating = updatedRate;
    }

}
