// 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 { partnerCustomerListConfig } from '@/shared/constants/list-configs';
import { Component, inject, Input } from '@angular/core';
import { Router } from '@angular/router';
import { partnerCustomersNamedRoutes } from '../constants';
import { ICustomerResponse } from '../models';
import { CustomersService } from '../services/main.service';

@Component({
  selector: 'partner-customer-list',
  templateUrl: './list.component.html',
  imports: [PageDataListComponent],
})
export class PartnerCustomerListComponent extends AbstractList<ICustomerResponse> {
  @Input() fullHeight?: boolean;
  @Input() header: IColumn[] = partnerCustomerListConfig.columns;

  private readonly service = inject(CustomersService);
  private readonly router = inject(Router);

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

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

  toSinglePage(item: ICustomerResponse) {
    this.router.navigateByUrl(partnerCustomersNamedRoutes.customer.meta.pagePath!(item.id));
  }
}
