import { Component, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AuthService } from '../../core/services/auth.service';
import { AdminDashboardComponent } from './admin-dashboard/admin-dashboard.component';
import { DepartmentDashboardComponent } from './department-dashboard/department-dashboard.component';
import { ApplicantDashboardComponent } from './applicant-dashboard/applicant-dashboard.component';

@Component({
  selector: 'app-dashboard',
  standalone: true,
  imports: [
    CommonModule,
    AdminDashboardComponent,
    DepartmentDashboardComponent,
    ApplicantDashboardComponent,
  ],
  template: `
    @switch (userType()) {
      @case ('ADMIN') {
        <app-admin-dashboard />
      }
      @case ('DEPARTMENT') {
        <app-department-dashboard />
      }
      @case ('APPLICANT') {
        <app-applicant-dashboard />
      }
    }
  `,
})
export class DashboardComponent {
  private readonly authService = inject(AuthService);
  readonly userType = this.authService.userType;
}
