import { Component } from '@angular/core';
import { CommonNzModule } from '../../../../../common.nz.module';
import { KnowledgeService } from '../../../../../services/knowledge.service';
import { StarIconComponent } from '../../../../../shared/star/star.icon';

const colorMap: Record<string, string> = {
  '红色': '#FF0000',
  '橙色': '#EB5D00',
  '黄色': '#FBE800',
  '蓝色': '#4677F2',
};

@Component({
  selector: 'knowledge-risk-level',
  standalone: true,
  imports: [CommonNzModule, StarIconComponent],
  templateUrl: './knowledge-risk-level.component.html',
  styleUrl: './knowledge-risk-level.component.less',
})
export class KnowledgeRiskLevelComponent {
  colorMap = colorMap;
  constructor(private readonly knowledge: KnowledgeService) {}
  get tableData() {
    return this.knowledge.levels();
  }
  get updateDate() {
    return this.knowledge.levelUpdateDate();
  }
}
