import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ListViewEventData } from 'nativescript-ui-listview';
import { WarehouseItemAllOutput } from '../../entities/output/warehouseItemAllOutput';

@Component({
    selector: 'MaterialUnitList',
    moduleId: module.id,
    templateUrl: './material-unit-list-view.component.html',
    styleUrls: ['./material-unit-list-view.component.scss']
})

export class MaterialUnitListComponent {
    @Input() items: WarehouseItemAllOutput[];
    @Output() tapItem = new EventEmitter<WarehouseItemAllOutput>();

    // @Output() tapPhoto = new EventEmitter<WarehouseItemAllOutput>();

    templateSelector(item: any, index: number, items: any): string {
        return 'default';
    }

    onTapItem(event: ListViewEventData) {
        this.tapItem.emit(this.items[event.index]);
    }

    // onTakePhoto(item: WarehouseItemAllOutput) {
    //     this.tapPhoto.emit(item);
    // }

}
