// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
import { Component, inject } from '@angular/core';
import { UserComplexFormComponent } from '../components/form.component';
import { IDeviceResponse } from '../models';
import { SuperAdminDeviceService } from '../services/main.service';

@Component({
  selector: 'superAdmin-deviceBrands',
  templateUrl: './list.component.html',
  imports: [PageDataListComponent, UserComplexFormComponent],
})
export class DevicesComponent extends AbstractList<IDeviceResponse> {
  private readonly service = inject(SuperAdminDeviceService);

  override setColumns(): void {
    this.columns = [
      { field: 'id', header: 'شناسه', type: 'id' },
      { field: 'name', header: 'عنوان' },
      {
        field: 'brand',
        header: 'برند دستگاه',
        type: 'nested',
        nestedOption: { path: 'brand.name' },
      },
      {
        field: 'created_at',
        header: 'تاریخ ایجاد',
        type: 'date',
      },
    ];
  }

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

  // toSinglePage(partner: IDeviceBrandResponse) {
  //   this.router.navigateByUrl(partnersNamedRoutes.partner.meta.pagePath!(partner.id));
  // }
}
