// 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 { goodListConfig } from '@/shared/constants/list-configs';
import { Component, inject, Input } from '@angular/core';
import { IConsumerBusinessActivityGoodResponse } from '../../models/goods_io';
import { BusinessActivityGoodsService } from '../../services/goods.service';
import { ConsumerBusinessActivityGoodFormComponent } from './form.component';

@Component({
  selector: 'consumer-businessActivity-goods-list',
  templateUrl: './list.component.html',
  imports: [PageDataListComponent, ConsumerBusinessActivityGoodFormComponent],
})
export class ConsumerBusinessActivityGoodsListComponent extends AbstractList<IConsumerBusinessActivityGoodResponse> {
  @Input({ required: true }) businessId!: string;
  @Input({ required: true }) guildId!: string;
  @Input() fullHeight?: boolean;
  @Input() header: IColumn[] = goodListConfig.columns;

  listConfig = goodListConfig;
  service = inject(BusinessActivityGoodsService);

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

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