// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
import { BreadcrumbService } from '@/core/services';
import pageParamsUtils from '@/utils/page-params.utils';
import { Component, computed, inject, signal } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ConsumerComplexListComponent } from '../../components/complexes/list.component';
import { consumerComplexesNamedRoutes } from '../../constants/routes/complexes';
import { BusinessActivityStore } from '../../store/businessActivity.store';

@Component({
  selector: 'superAdmin-user-complexes',
  templateUrl: './list.component.html',
  imports: [ConsumerComplexListComponent],
})
export class ConsumerComplexesComponent {
  private readonly route = inject(ActivatedRoute);
  private readonly breadcrumbService = inject(BreadcrumbService);
  private readonly businessStore = inject(BusinessActivityStore);

  pageParams = computed(() => pageParamsUtils(this.route));
  businessId = signal<string>(this.pageParams()['businessActivityId']);

  ngAfterViewInit() {
    this.setBreadcrumb();
  }

  setBreadcrumb() {
    this.breadcrumbService.setItems([
      ...this.businessStore.breadcrumbItems(),
      {
        title: consumerComplexesNamedRoutes.complexes.meta.title,
        routerLink: consumerComplexesNamedRoutes.complexes.meta.pagePath!(this.businessId()),
      },
    ]);
  }
}
