import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../avatar-placeholder/avatar-placeholder.component";
import * as i2 from "../paginated-list/paginated-list.component";
/**
 * The `UserListComponent` can display a list of Stream users with pagination
 */
export class UserListComponent {
    constructor() {
        /**
         * The users to display
         */
        this.users = [];
        /**
         * If `true`, the loading indicator will be displayed
         */
        this.isLoading = false;
        /**
         * If `false` the component won't ask for more data vua the `loadMore` output
         */
        this.hasMore = false;
        /**
         * The component will signal via this output when more items should be fetched
         *
         * The new items should be appended to the `items` array
         */
        this.loadMore = new EventEmitter();
    }
    trackByUserId(_, item) {
        return item.id;
    }
}
UserListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UserListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
UserListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: UserListComponent, selector: "stream-user-list", inputs: { users: "users", isLoading: "isLoading", hasMore: "hasMore" }, outputs: { loadMore: "loadMore" }, ngImport: i0, template: "<stream-paginated-list\n  [items]=\"users\"\n  [hasMore]=\"hasMore\"\n  (loadMore)=\"loadMore.emit()\"\n  [isLoading]=\"isLoading\"\n  [trackBy]=\"trackByUserId\"\n>\n  <ng-template let-user=\"item\">\n    <div class=\"str-chat__user-list-item\">\n      <stream-avatar-placeholder\n        data-testclass=\"avatar\"\n        class=\"str-chat__avatar str-chat__avatar--circle\"\n        type=\"user\"\n        location=\"reaction\"\n        [imageUrl]=\"user.image\"\n        [name]=\"user.name\"\n        [user]=\"user\"\n      ></stream-avatar-placeholder>\n      <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n        user.name\n      }}</span>\n    </div>\n  </ng-template>\n</stream-paginated-list>\n", dependencies: [{ kind: "component", type: i1.AvatarPlaceholderComponent, selector: "stream-avatar-placeholder", inputs: ["name", "imageUrl", "location", "channel", "user", "type", "initialsType", "showOnlineIndicator"] }, { kind: "component", type: i2.PaginatedListComponent, selector: "stream-paginated-list", inputs: ["items", "isLoading", "hasMore", "trackBy"], outputs: ["loadMore"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UserListComponent, decorators: [{
            type: Component,
            args: [{ selector: 'stream-user-list', template: "<stream-paginated-list\n  [items]=\"users\"\n  [hasMore]=\"hasMore\"\n  (loadMore)=\"loadMore.emit()\"\n  [isLoading]=\"isLoading\"\n  [trackBy]=\"trackByUserId\"\n>\n  <ng-template let-user=\"item\">\n    <div class=\"str-chat__user-list-item\">\n      <stream-avatar-placeholder\n        data-testclass=\"avatar\"\n        class=\"str-chat__avatar str-chat__avatar--circle\"\n        type=\"user\"\n        location=\"reaction\"\n        [imageUrl]=\"user.image\"\n        [name]=\"user.name\"\n        [user]=\"user\"\n      ></stream-avatar-placeholder>\n      <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n        user.name\n      }}</span>\n    </div>\n  </ng-template>\n</stream-paginated-list>\n" }]
        }], propDecorators: { users: [{
                type: Input
            }], isLoading: [{
                type: Input
            }], hasMore: [{
                type: Input
            }], loadMore: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1saXN0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3N0cmVhbS1jaGF0LWFuZ3VsYXIvc3JjL2xpYi91c2VyLWxpc3QvdXNlci1saXN0LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3N0cmVhbS1jaGF0LWFuZ3VsYXIvc3JjL2xpYi91c2VyLWxpc3QvdXNlci1saXN0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSx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