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

@Component({
    selector: 'AdvertisingCategoryListView',
    moduleId: module.id,
    templateUrl: './advertising-category-list-view.component.html',
    styleUrls: ['./_advertising-category-list-view.component.scss']
})

export class AdvertisingCategoryListViewComponent {
    @Input() items: AdvertisingCategoryAllResult[];
    @Output() tapItem = new EventEmitter<number>();

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

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

    get rightIcon() {
        return String.fromCharCode(0xf105);
    }
}
