import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"],
})
export class AppComponent implements OnInit {
  title = "Talenttic Tech Hub CRM";
  companyLocalStorage: any;

  constructor(private router: Router) {
    this.companyLocalStorage = localStorage.getItem("companyData");
  }

  ngOnInit(): void {
    if (this.companyLocalStorage !== null) {
      this.router.navigate(["company-information"]);
    } else {
      this.router.navigate(["login"]);
    }
  }
}
