import { Component, Input, SimpleChanges } from '@angular/core';
import { verticalInOutRelative } from '../../../../../../common.animation';
import { CommonNzModule } from './../../../../../../common.nz.module';
import { ScrollImagesComponent } from './../../../../../../shared/scroll-images/scroll-images.component';

@Component({
  selector: 'panel-hazard-progress',
  standalone: true,
  imports: [CommonNzModule, ScrollImagesComponent],
  templateUrl: './hazard-progress.component.html',
  styleUrl: './hazard-progress.component.less',
  animations: [verticalInOutRelative],
})
export class HazardProgressComponent {
  @Input() data!: Hazard.HazardDto;

  checkedMap: Record<string, boolean> = {};

  ngOnChanges(changes: SimpleChanges) {
    if (changes['data']) {
      this.checkedMap = {};
    }
  }
  toggleCollapse(key: string) {
    this.checkedMap[key] = !this.checkedMap[key];
  }
}
