import { Component } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-contract-type',
  templateUrl: './contract-type.component.html',
  styleUrls: ['./contract-type.component.scss'],
})
export class ContractTypeComponent {
  contractType!: number;
  constructor(
    private readonly router: Router,
    private readonly route: ActivatedRoute
  ) {}
  onChooseType(type: number): void {
    this.contractType = type;
  }

  onClickNext(): void {
    if (this.contractType === 0) {
      this.router.navigate(['contractor-type'], { relativeTo: this.route });
    }
  }
}
