// 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 { ConsumerPosesComponent } from '../../components/poses/list.component';
import { superAdminConsumerPosesNamedRoutes } from '../../constants/routes/poses';
import { BusinessActivityStore } from '../../store/businessActivity.store';
import { ComplexStore } from '../../store/complex.store';
import { ConsumerStore } from '../../store/consumer.store';

@Component({
  selector: 'superAdmin-user-poses',
  templateUrl: './list.component.html',
  imports: [ConsumerPosesComponent],
})
export class SuperAdminUserPosesComponent {
  private readonly route = inject(ActivatedRoute);
  private readonly breadcrumbService = inject(BreadcrumbService);
  private readonly consumerStore = inject(ConsumerStore);
  private readonly businessStore = inject(BusinessActivityStore);
  private readonly complexStore = inject(ComplexStore);

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

  ngOnInit() {
    this.setBreadcrumb();
  }

  setBreadcrumb() {
    this.breadcrumbService.setItems([
      ...this.consumerStore.breadcrumbItems(),
      ...this.businessStore.breadcrumbItems(),
      ...this.complexStore.breadcrumbItems(),
      {
        title: superAdminConsumerPosesNamedRoutes.poses.meta.title,
        routerLink: superAdminConsumerPosesNamedRoutes.poses.meta.pagePath!(
          this.consumerId(),
          this.businessId(),
          this.complexId(),
        ),
      },
    ]);
  }
}
