// 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 { GuildGoodsListComponent } from '../../components/goods/list.component';
import { guildGoodsNamedRoutes } from '../../constants/routes/goods';
import { GuildStore } from '../../store/guild.store';

@Component({
  selector: 'admin-guild-goods',
  templateUrl: './list.component.html',
  imports: [GuildGoodsListComponent],
})
export class GuildGoodsComponent {
  private readonly route = inject(ActivatedRoute);
  private readonly breadcrumbService = inject(BreadcrumbService);
  private readonly store = inject(GuildStore);

  pageParams = computed(() => pageParamsUtils(this.route));
  readonly guildId = signal<string>(this.pageParams()['guildId']!);

  ngOnInit() {
    this.setBreadcrumb();
  }

  setBreadcrumb() {
    this.breadcrumbService.setItems([
      ...this.store.breadcrumbItems(),
      {
        title: guildGoodsNamedRoutes.goods.meta.title,
      },
    ]);
  }
}
