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

@Component({
  selector: 'app-type-header',
  templateUrl: './type-header.component.html',
  styleUrls: ['./type-header.component.scss'],
})
export class TypeHeaderComponent implements OnInit {
  constructor(private readonly route: ActivatedRoute) {}

  typeName!: string;

  ngOnInit(): void {
    this.route.queryParams.pipe().subscribe((res) => {
      console.log(res);
      if (+res['type'] === 0) {
        this.typeName = 'Business';
      } else if (+res['type'] === 1) {
        this.typeName = 'Contractor';
      } else {
        this.typeName = 'Employee';
      }
    });
  }
}
