import { Component, inject, signal } from '@angular/core';
import { Router, RouterLink, RouterLinkActive } from '@angular/router';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { faMoon } from '@fortawesome/free-solid-svg-icons';
import { faSun } from '@fortawesome/free-solid-svg-icons';
import { ThemeSwitchService } from '../../service/theme-switch.service';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import { ButtonModule } from "primeng/button";

@Component({
  selector: 'app-navigation-bar',
  imports: [FontAwesomeModule, RouterLink, RouterLinkActive, TranslatePipe, ButtonModule],
  templateUrl: './navigation-bar.html',
  styleUrl: './navigation-bar.scss'
})
export class NavigationBar {

  private router = inject(Router);
  protected themeSwitchService = inject(ThemeSwitchService);
  protected translateService = inject(TranslateService);

  showMobileMenu = signal(false);

  constructor() {}

  isActive(route: string): boolean {
    return this.router.url === route;
  }

  toggleLanguage(): void {
    this.translateService.use(this.translateService.getCurrentLang() === 'de' ? 'en' : 'de');
  }

  faMoon = faMoon;
  faSun = faSun;

}
