import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ListViewEventData } from 'nativescript-ui-listview';
import { EnrollNumberAllPersonOutput } from '~/pages/sts/entities/output/enrollNumberAllPersonOutput';

@Component({
    selector: 'StsNumberListView',
    moduleId: module.id,
    templateUrl: './sts-number-list-view.component.html',
    styleUrls: ['./_sts-number-list-view.component.scss']
})
export class StsNumberListViewComponent {
    @Input() stsNumbers: EnrollNumberAllPersonOutput[];
    @Output() itemTap = new EventEmitter<string>();

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

    onItemTap(event: ListViewEventData) {
        this.itemTap.emit(this.stsNumbers[event.index].DisplayName);
    }
}
