// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
import {
  IColumn,
  PageDataListComponent,
} from '@/shared/components/pageDataList/page-data-list.component';
import { categoryListConfig } from '@/shared/constants/list-configs';
import { Component, computed, inject, Input } from '@angular/core';
import { guildGoodCategoriesNamedRoutes } from '../../constants/routes/goodCategories';
import { IGoodCategoriesResponse } from '../../models';
import { GuildGoodCategoriesService } from '../../services/goodCategories.service';
import { GuildGoodCategoryFormComponent } from './form.component';

@Component({
  selector: 'admin-guild-good-categories-list',
  templateUrl: './list.component.html',
  imports: [PageDataListComponent, GuildGoodCategoryFormComponent],
})
export class GuildGoodCategoriesListComponent extends AbstractList<IGoodCategoriesResponse> {
  @Input() guildId!: string;
  @Input() fullHeight?: boolean;
  @Input() showAllBtn?: boolean;
  @Input() header: IColumn[] = categoryListConfig.columns;

  listConfig = categoryListConfig;
  service = inject(GuildGoodCategoriesService);

  allItemsPageRoute = computed(() =>
    guildGoodCategoriesNamedRoutes.goodCategories.meta.pagePath!(this.guildId),
  );

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

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