import { Component, inject, signal } from '@angular/core';
import { RouterModule } from '@angular/router';
import { Contact } from "../../admin/contact/contact";
import { AuthService } from '../../auth/auth.service';
@Component({
  selector: 'app-admin-layout',
  imports: [RouterModule, Contact],
  templateUrl: './admin-layout.html',
  styleUrl: './admin-layout.scss'
})
export class AdminLayout {
  authSvc = inject(AuthService);
  loggedIn = signal(false);

  constructor() {
    this.loggedIn.set(this.authSvc.currentToken !== null);
    this.authSvc.accessTokenSub.subscribe(token => {
      this.loggedIn.set(token !== null);
    });
  }
}
