// 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 { Component, inject, Input } from '@angular/core';
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() header: IColumn[] = [
    { field: 'id', header: 'شناسه', type: 'id' },
    { field: 'name', header: 'عنوان' },
    { field: 'goods_count', header: 'تعداد کالاها' },
    {
      field: 'created_at',
      header: 'تاریخ ایجاد',
      type: 'date',
    },
  ];
  service = inject(GuildGoodCategoriesService);

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

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