// 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 { partnerConsumerAccountListConfig } from '@/shared/constants/list-configs';
import { Component, inject, Input } from '@angular/core';
import { IConsumerAccountResponse } from '../../models';
import { PartnerConsumerAccountsService } from '../../services/accounts.service';
import { ConsumerAccountFormComponent } from './form.component';

@Component({
  selector: 'partner-consumer-account-list',
  templateUrl: './list.component.html',
  imports: [PageDataListComponent, ConsumerAccountFormComponent],
})
export class ConsumerAccountListComponent extends AbstractList<IConsumerAccountResponse> {
  @Input({ required: true }) consumerId!: string;
  @Input() fullHeight?: boolean;
  @Input() header: IColumn[] = partnerConsumerAccountListConfig.columns;
  private readonly service = inject(PartnerConsumerAccountsService);

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

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