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

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

export class ReservationBorrowedListComponent {
    @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]);
    }
}
