// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
import { BreadcrumbService } from '@/core/services';
import { Component, inject, signal } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { superAdminConsumerAccountsNamedRoutes } from '../../../consumers/constants/routes/accounts';
import { ConsumerAccountListComponent } from '../../components/accounts/list.component';
import { superAdminPartnersNamedRoutes } from '../../constants';
import { PartnerStore } from '../../store/partner.store';

@Component({
  selector: 'superAdmin-partner-accounts',
  templateUrl: './list.component.html',
  imports: [ConsumerAccountListComponent],
})
export class ConsumerAccountsComponent {
  private readonly route = inject(ActivatedRoute);
  private readonly breadcrumbService = inject(BreadcrumbService);
  private readonly store = inject(PartnerStore);

  partnerId = signal<string>(this.route.snapshot.params['partnerId']);

  ngOnInit() {
    this.setBreadcrumb();
  }

  setBreadcrumb() {
    this.breadcrumbService.setItems([
      {
        ...superAdminPartnersNamedRoutes.partners.meta,
        routerLink: superAdminPartnersNamedRoutes.partners.meta.pagePath!(),
      },
      {
        title: this.store.entity()?.name,
        routerLink: superAdminPartnersNamedRoutes.partner.meta.pagePath!(this.partnerId()),
      },
      {
        title: superAdminConsumerAccountsNamedRoutes.accounts.meta.title,
      },
    ]);
  }
}
