// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
import { userListConfig } from '@/shared/constants/list-configs';
import { Component, inject } from '@angular/core';
import { Router } from '@angular/router';
import { UserAccountFormComponent } from '../components/form.component';
import { usersNamedRoutes } from '../constants';
import { IUserResponse } from '../models';
import { UsersService } from '../services/main.service';

@Component({
  selector: 'superAdmin-users',
  templateUrl: './list.component.html',
  imports: [PageDataListComponent, UserAccountFormComponent],
})
export class UsersComponent extends AbstractList<IUserResponse> {
  private readonly service = inject(UsersService);
  private readonly router = inject(Router);

  override setColumns(): void {
    this.columns = userListConfig.columns;
  }

  override getDataRequest() {
    return this.service.getAll();
  }

  toSinglePage(item: IUserResponse) {
    this.router.navigateByUrl(usersNamedRoutes.user.meta.pagePath!(item.id));
  }
}
