import { Component, Input } from '@angular/core';
import { CommonNzModule } from './../../../common.nz.module';
import { KnowledgeService } from './../../../services/knowledge.service';

@Component({
  selector: 'risk-item-visual',
  standalone: true,
  imports: [CommonNzModule],
  templateUrl: './risk-item-visual.component.html',
  styleUrl: './risk-item-visual.component.less',
})
export class RiskItemVisualComponent {
  @Input() data!: Knowledge.RiskItem;

  constructor(private knowledge: KnowledgeService) {}

  get types() {
    return this.knowledge.types();
  }
  get categories() {
    return this.knowledge.categories();
  }

  get categoryName() {
    return this.knowledge.getCategoryName(this.data.category, this.data.type);
  }

  get typeName() {
    return this.knowledge.getTypeName(this.data.type);
  }
}
