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

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

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

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

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