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;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: UserListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.0", 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      />\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: "17.0.0", 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      />\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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1saXN0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3N0cmVhbS1jaGF0LWFuZ3VsYXIvc3JjL2xpYi91c2VyLWxpc3QvdXNlci1saXN0LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3N0cmVhbS1jaGF0LWFuZ3VsYXIvc3JjL2xpYi91c2VyLWxpc3QvdXNlci1saXN0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLE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