import { Component } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';

export interface ViaLevel{
  code: string;
  name: string;
}
@Component({
    selector: 'app-via-level-selector',
    templateUrl: './via-level-selector.component.html',
    styleUrl: './via-level-selector.component.css',
    standalone: false
})
export class ViaLevelSelectorComponent {
  viaLevels: ViaLevel[];
  levelFormControl: FormControl;

  constructor() {
    this.viaLevels = [
      { code: 'S01', name: 'Nivel sobre túnel' },
      { code: 'S02', name: 'Nivel techo - túnel' },
      { code: 'S03', name: 'Nivel túnel' },
      { code: 'S04', name: 'Nivel vía' },
      { code: 'S05', name: 'Nivel debajo de vía' },
    ];

    this.levelFormControl = new FormControl('', Validators.required);
  }

  changeLevel(level: string){
    this.levelFormControl.setValue(level);
  }
}
